Download the PHP package melvilleco/instagram-basic-display without Composer

On this page you can find all versions of the php package melvilleco/instagram-basic-display. 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 instagram-basic-display

Instagram Basic Display plugin for Craft CMS 3.x

This plugin creates endpoints in your Craft install for you to consume the Instagram Basic Display API as well as the oEmbed API. It also provides some helper methods for dealing with your access token and getting refresh tokens.

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
  2. Then tell Composer to load the plugin:

    composer require melvilleco/instagram-basic-display
  3. Obtain a long-lived access token from Instagram (see example video below) and insert it into your database.

How to get an initial access token for the Instagram Basic Display API - Watch Video

Instagram Basic Display Overview

This plugin provides some helper methods and endpoints for working with the Instagram Basic Display API and the Instagram OEmbed service.

The plugin makes available several useful console commands and controller actions to help you access your Instagram content.

Configuration

Configuration is done via the src/config.php config file. It should be renamed to instagram-basic-display.php and copied to your config/ directory to take effect.

The most likely options you may want to change are cache_duration and fields. fields simply determines what data is returned by the request.

Inserting Your Access Token

By default, Instagram User Access Tokens are short-lived and are valid for one hour. However, short-lived tokens can be exchanged for long-lived tokens.

Long-lived tokens are valid for 60 days and can be refreshed as long as they are at least 24 hours old but have not expired, and the app user has granted your app the instagram_graph_user_profile permission.

After you obtain your long-lived token, run the following command to insert it into your database:

  ./craft instagram-basic-display/token/insert [YOUR_TOKEN_HERE]

Refreshing Your Token

As long-lived tokens are only valid for 60 days, you will need to periodically request a refreshed token. You can easily do this by setting up a cron task that calls the refresh method of the plugin:

  ./craft instagram-basic-display/token/refresh

Your old token will be used to obtain a new one, and the new token will be inserted into the database.

Commands and Endpoints

Console Commands

The following console commands are available:


Get the expiration date/time of the current token:

  ./craft instagram-basic-display/token/exp

Echo out the current access token:

  ./craft instagram-basic-display/token/get

Manually insert an access token into the database:

  ./craft instagram-basic-display/token/insert

Refresh the current token:

  ./craft instagram-basic-display/token/refresh

Accessing your Instagram feed as JSON

If accessing your feed from inside a Vue or React component, you can hit the following endpoint to get a JSON response:

  /actions/instagram-basic-display/feed/get

Getting Your Feed in Twig

You can also output your feed inside your Twig templates using a {% for %} loop:

Instagram Basic Display Roadmap

Some things to do, and ideas for potential features:

Brought to you by Jonathan Melville


All versions of instagram-basic-display with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.0.0
ext-json Version *
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 melvilleco/instagram-basic-display contains the following files

Loading the files please wait ....