This time I will share jQuery Plugin and tutorial about Spectragram – Fetch and Display Instagram Feeds, hope it will help you in programming stack.
Spectragram is an easy jQuery plugin for Instagram API to get the most recent media published by a user.
How to use it:
1. Include jquery script and spectragram.js
1 |
<script src= "jquery.min.js" ></script> |
2 |
<script src= "js/spectragram.js" ></script> |
2. Set your Instagram accessToken.
1 |
jQuery.fn.spectragram.accessData = { |
2 |
accessToken: '[your-instagram-access-token]' |
3. Call the spectagram function on the container element in which you want to display the Instagram feeds.
1 |
$( 'ul' ).spectragram( 'getRecentTagged' ,{ |
4. Specify the max number of Instagram photos to display. Default: 25.
1 |
$( 'ul' ).spectragram( 'getRecentTagged' ,{ |
5. Specify the size of Instagram photos: ‘small’, ‘medium’ or ‘large’ (default).
1 |
$( 'ul' ).spectragram( 'getRecentTagged' ,{ |
6. Determine the HTML element to hold Instagram photos. Default: ‘<li></li>’.
1 |
$( 'ul' ).spectragram( 'getRecentTagged' ,{ |
2 |
wrapEachWith: '<span></span>' |
7. Execute a callback function after all photos are fetched & displayed.
1 |
$( 'ul' ).spectragram( 'getRecentTagged' ,{ |
Changelog:
2019-02-04
- v2.0.0: Upgrades Instagram API
2019-02-04
- v1.1.1: Retire getRecentTagged method
2018-04-16
- v1.1.0: Remove deprecated endpoints and functions
2016-02-29
- v1.0.3: Improve image html and fix empty wrap issue
2016-02-22
- v1.0.1: improve message handling.
2015-09-02
- Bug fix for title truncation when it contains single quotes.
2015-03-12
- Bug fix for title truncation when it contains single quotes.
2013-11-13
- use access_token instead of client_id for getUserFeed.
- Fixes a issue of Uncaught TypeError: Cannot read property ‘length’ of undefined
This awesome jQuery plugin is developed by adrianengine. For more Advanced Usages, please check the demo page or visit the official website.