JavaScript Library To Fetch And Display Instagram Feeds On The Webpage – instafetch.js

Category: Javascript , Social Media | September 13, 2018
Author: thomasvaeth
Views Total: 2,462
Official Page: Go to website
Last Update: September 13, 2018
License: MIT

Preview:

JavaScript Library To Fetch And Display Instagram Feeds On The Webpage – instafetch.js

Description:

instafetch.js is an easy-to-implement, dependency-free JavaScript library that has the ability to fetch and display the latest Instagram images with captions using Instagram API. Includes the ES6-Promise polyfill for Internet Explorer support.

How to use it:

Place the minified version of the instafetch.js at the bottom of the webpage.

<script src="instafetch.min.js"></script>

Create an empty container with an unique ID ‘instafetch’.

<div id="instafetch"></div>

Initialize the instafetch.js and insert your own access token as this:

document.addEventListener('DOMContentLoaded', function() {
  instafetch.init({
    accessToken: 'ACCESS TOKEN'
  });
});

Specify the maximum number of Instagram photos to display.

document.addEventListener('DOMContentLoaded', function() {
  instafetch.init({
    accessToken: 'ACCESS TOKEN',
    numOfPics: 10
  });
});

Decide whether to display the image captions.

document.addEventListener('DOMContentLoaded', function() {
  instafetch.init({
    accessToken: 'ACCESS TOKEN',
    caption: true
  });
});

Specify the CSS ID of the target container.

document.addEventListener('DOMContentLoaded', function() {
  instafetch.init({
    accessToken: 'ACCESS TOKEN',
    target: 'instafetch'
  });
});

Changelog:

09/13/2018

  • Fixed bug for images without caption.

You Might Be Interested In:


Leave a Reply