Download the PHP package jahudka/libigfeed without Composer

On this page you can find all versions of the php package jahudka/libigfeed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package libigfeed

LibIgFeed

a library which makes it a little easier to embed an Instagram feed in your website

This library encapsulates a little part of the logic needed to embed an Instagram feed in a website. Provided with the appropriate credentials it will fetch a list of the latest posts from your Instagram account which you can then persist locally using any persistence layer you wish. Additionally, you can download the media represented by a post for further processing, such as generating responsive thumbnails.

Dependencies

Installation

Usage

  1. Follow these instructions to create a new Facebook App, configure Instagram Basic Display and add yourself as a test user. Use something meaningful for the Valid OAuth Redirect URIs, you'll need it later. Stop at step 4 ("Authenticate the Test User").

  2. When you're done, you need to find out your Instagram App ID and Secret. From the dashboard of your new app select Instagram Basic Display / Basic Display in the Products section of the sidebar. Scroll down a bit and you'll find them.

  3. Pass these to the constructor of the IgFeed\Lib\Client class like so:

  4. You also need to set up the OAuth authentication endpoint mentioned in step 1. All this endpoint needs to do is call $client->exchangeCodeForAccessToken($redirectUri, $code), where $redirectUri is the URL of the endpoint and $code is the authorization code returned by Instagram from the OAuth authentication flow in the code query string parameter.

  5. To actually trigger the OAuth authentication flow you need to go to a special URL. You usually only need to do this once in a blue moon, because the access token is valid for 60 days and can be renewed automatically, which the library does for you. The way I usually implement this is:

    • In the admin dashboard of the website I call $client->isConnected().
    • If it returns false, I display a warning message with a link to $client->getAuthorizationUrl($redirectUri).
  6. When you have successfully authenticated your website you can use the $client->getLatestMedia() method to get the latest content from your Instagram feed. The method returns a Generator of IgFeed\Lib\Media instances. This method will also automatically refresh the access token in the background if it's less than 24 hours from expiration.

    The idea is to set up a cron job to synchronise a local copy of your Instagram feed every couple of hours - that way the access token should safely refresh when needed, and your website shouldn't be slowed down by loading your Instagram content on-demand. You can also use $client->download($media, $dst) to download the actual media files so that your site doesn't depend on them loading from Instagram.

Usage within a Nette application

  1. Register and configure the IgFeed\Bridges\NetteDI\IgFeedExtension in your config.neon:

  2. Let Nette DI do its magic and inject the IgFeed\Lib\Client instance in your presenters and services as needed.

  3. Prosper :-)

All versions of libigfeed with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
guzzlehttp/guzzle Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jahudka/libigfeed contains the following files

Loading the files please wait ....