Add Instagram Photos To Your Website Without API – instagramFeed

Category: Javascript , Social Media | February 8, 2020
Author: jsanahuja
Views Total: 228
Official Page: Go to website
Last Update: February 8, 2020
License: MIT

Preview:

Add Instagram Photos To Your Website Without API – instagramFeed

Description:

This is the Vanilla JavaScript version of the jQuery instagramFeed plugin, which helps you create a gallery fetching and displaying Instagram photos from any user (or any tag you provide) on your webpage.

Without the need of the Instagram access token.

How to use it:

1. Download and load the minified version of the instagramFeed library in the document.

<script src="dist/InstagramFeed.min.js"></script>

2. Create a placeholder element for the Instagram gallery.

<div id="instagram-feed-demo" class="instagram_feed"></div>

3. Initialize the instagramFeed library and specify the Instagram user (or tag) and container element as follows:

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo" 
});

4. Decide whether to display the profile, biography, gallery, and IGTV.

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'display_profile': true,
    'display_biography': true,
    'display_gallery': true,
    'display_igtv': false,
});

5. Determine the max number of items to display. Default: 8.

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'items': 10
});

6. Determine the number of items per row. Default: 4.

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'items_per_row': 3
});

7. Set the space between photos. Default: 0.5.

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'margin': 0.5
});

8. Customize the image size. Default: 640(px).

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'image_size': 480
});

9. Get raw data with the callback function.

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'get_raw_json': true,
    'callback': function(data) {
      // ...
    }
});

10. Disable the default styling and apply your own CSS to the Instagram gallery.

new InstagramFeed({
    'username': 'instagram',
    'container': "#instagram-feed-demo",
    'styling': false
});
.instagram_profile {
  /* custom styles here */
}

.instagram_profile_image {
  /* custom styles here */
}

.instagram_gallery {
  /* custom styles here */
}

.instagram_igtv {
  /* custom styles here */
}

Changelog:

02/08/2020

  • v1.3.2: hotfix

12/14/2019

  • Fixed usernames in image alt tags

You Might Be Interested In:


Leave a Reply