2017 © Pedro PelĂĄez
 

wordpress-plugin dude-insta-feed

Dude Instagram feed

image

digitoimistodude/dude-insta-feed

Dude Instagram feed

  • Tuesday, April 24, 2018
  • by ronilaukkarinen
  • Repository
  • 3 Watchers
  • 7 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 15 % Grown

The README.md

:bangbang: This repository is no longer actively maintained. The plugin still works, but does not receive any further updates other than community contributed fixes.

Dude insta feed

WordPress plugin to get latest images from Instagram user feeds., (*1)

Basically this plugin fetches images from Instagram, saves those to transient and next requests will be served from there. After transient has expired and deleted, new fetch from Instagram will be made and saved to transient. This implements very simple cache., (*2)

Handcrafted with love at Digitoimisto Dude Oy, a Finnish boutique digital agency in the center of JyvÀskylÀ., (*3)

NOTE!

DEPRECATED! This plugin does not work so well after Instagram has tightened their API usage. Better plugin to use is ig-graph-feed by Jake Peterson or our image-user-feed which bypass the official API., (*4)

Table of contents

  1. Please note before using
  2. License
    1. Legal
  3. Usage
    1. Usage example for displaying user feed
    2. Limiting feed items
  4. Hooks
  5. Composer
  6. Contributing

Please note before using

This plugin is not meant to be "plugin for everyone", it needs at least some basic knowledge about php and css to add it to your site and making it look beautiful., (*5)

This is a plugin in development for now, so it may update very often., (*6)

License

Dude insta feed is released under the GNU GPL 2 or later., (*7)

Please read Instagram's TOC to determine can you use images and what restrictions there may be., (*8)

Usage

This plugin does not have settings page or provide anything visible on front-end. So it's basically dumb plugin if you don't use any filters listed below., (*9)

Only mandatory filter to use is dude-insta-feed/access_token/user=$userid., (*10)

Get images by calling function dude_insta_feed()->get_user_images(), pass user id as a only argument. User's id can be obtained with this tool., (*11)

Usage example for displaying user feed

  1. Go to instagram.com/developer and register an application for your WordPress site. Please note that application must be registered with that exact user account you want to pull images from!
  2. Disable Implicit oAuth2 from security for next step to work.
  3. Generate access token by going to this url and adding your CLIENT ID and REDIRECT URIs to their appropriate places and click Authorize.
  4. Enable Implicit oAuth2 back.
  5. Get the code after #access_token= in the following URL and add this snippet to functions.php. Your user ID is in the beginning of access token, just before tge dot.
/**
 * Dude Instagram hashtag feed.
 */
add_filter( 'dude-insta-feed/access_token/user=USERID_HERE', function() { return 'ACCESS_TOKEN_HERE'; } );
  1. Add this loop to wherever you want to display your images:
<?php
$instagram_feed = dude_insta_feed()->get_user_images( 'USERID_HERE' );
foreach ($instagram_feed['data'] as $item) : ?>
    <img src="<?php echo $item['images']['standard_resolution']['url']; ?>" alt="" />
<?php endforeach; ?>

Limiting feed items

/**
 * Limit Instagram feed items
 */
add_filter( 'dude-insta-feed/user_images_parameters', function( $parameters ) {
  $parameters['count'] = '6';
  return $parameters;
} );

Hooks

All the settings are set with filters, and there is also few filters to change basic functionality and manipulate data before caching., (*12)

dude-insta-feed/access_token/user=$userid

Because Instagram's API restrictions, every user needs their own access token. Access token can be generated following this instruction., (*13)

Set the access token for specific user. Passed arguments are default access_token and user id., (*14)

Defaults to empty string., (*15)

dude-insta-feed/user_images_transient

Change name of the transient for user images, must be unique for every user. Passed arguments are default name and user id., (*16)

Defaults to dude-insta-user-$userid., (*17)

dude-insta-feed/user_images_parameters

Modify api call parameters, example count of images. Only passed argument is array of default parameters., (*18)

Defaults to access_token defined for user and image count of five., (*19)

dude-insta-feed/user_images

Manipulate or use data before it's cached to transient. Only passed argument is array of images., (*20)

dude-insta-feed/user_images_lifetime

Change image cache lifetime. Only passed argument is default lifetime in seconds., (*21)

Defaults to 600 (= ten minutes)., (*22)

Composer

To use with composer, run composer require digitoimistodude/dude-insta-feed dev-master in your project directory or add "digitoimistodude/dude-insta-feed":"dev-master" to your composer.json require., (*23)

Contributing

If you have ideas about the plugin or spot an issue, please let us know. Before contributing ideas or reporting an issue about "missing" features or things regarding to the nature of that matter, please read Please note section. Thank you very much., (*24)

The Versions

24/04 2018

dev-master

9999999-dev https://github.com/digitoimistodude/dude-insta-feed

Dude Instagram feed

  Sources   Download

MIT

plugin wordpress

27/07 2017

0.1.0

0.1.0.0 https://github.com/digitoimistodude/dude-insta-feed

Dude Instagram feed

  Sources   Download

MIT

plugin wordpress