Download the PHP package nixondesign/craft-instagram without Composer

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

Instagram

This plugin provides easy access to the Instagram Basic Display API for Craft CMS.

Features:

Authorising Instagram

Before you can authorise the plugin you must first set up a Facebook app, this is the app you'll be using to authorise users and make API calls. Once set up you will require the App ID and App Secret. To set up your app, follow steps 1 to 3 in the offical getting started guide. When asked for your "Valid OAuth Redirect URIs", use the URL found in the plugin settings page. If using multisite you'll need to create test users for each account you want to authorise.

Plugin Setup

  1. First either make sure you are logged into the Instgram account you want to authenticate or are logged out completely.
  2. Navigate to the plugin settings page, if running Craft multisite switch to the appropriate site.
  3. Enter the App ID and App Secret, found under App Dashboard > Products > Instagram > Basic Display. These can be set to environment variables.
  4. Click "Authenticate" where you'll be taken to Instagram to authorise the plugin. Once authorised you will be redirected back to the plugin page.

Refreshing Access Tokens

This plugin uses long-lived access tokens which are valid for 60 days. These tokens can be refreshed to increase their life by another 60 days using the instagram/tokens/refresh CLI command. This command could be run periodically via cron.

Tokens can also be refreshed via the control panel.

Displaying a users media

Fetching the users can be handled in two ways, via Twig or using JSON returned from an action URL.

Twig

A users media can be displayed using the getMedia() method. This method accepts an optional options parameter.

Media Object

Property Description
id ID.
caption Caption text. Not returnable for Media in albums
username Owner's username
timestamp Publish date
permalink Permanent URL
mediaUrl URL
mediaType Type of media. Can be IMAGE, VIDEO, or CAROUSEL_ALBUM
thumbnailUrl thumbnail image URL. Only available on video Media
getUrl() Either the mediaUrl or thumbnailUrl depending on media type
getImg() Returns an image element

Paging

In addition to the media property, getMedia also returns before and after properties for pagination.

JSON

The media feed is available as JSON via the instagram/media/fetch action URL. Options can be passed as query parameters.

Pagination

Pagination can be implemented by using the before and after properties sent along with the media property.

These can be then sent as options with the next request.

Twig

Action URL

Options

Both the Twig Variable and JSON endpoint accept the following options:

Option Description Default
after Unique marker which to fetch media after null
before Unique marker which to fetch media before null
cache The duration to cache data for in seconds, set to false for no caching 300
limit The number of media items to fetch, if null uses Instagram's default null

All versions of craft-instagram with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^4.2.0
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 nixondesign/craft-instagram contains the following files

Loading the files please wait ....