This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Fetches and Caches a Instagram Feed | |
* | |
* - Get an Instagram Developer Account here: https://www.instagram.com/developer/ | |
* - Create a new client, using the 'redirect URI' as https://rudrastyh.com/tools/access-token | |
* - Get an access token here: https://rudrastyh.com/tools/access-token | |
* - This file will return JSON - so use some AJAX on the front-end to display | |
* - Add the instagram-feed-cache.json file as ignored, to .gitignore | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// one-liner version | |
// retains latin-1 supplement chars as well as latin extended-a and latin extended-b | |
Shopify.handleize = function (str) { | |
return str.toLowerCase().replace(/[^\w\u00C0-\u024f]+/g, "-").replace(/^-+|-+$/g, ""); | |
}; |