Plugin: Instagram gatherer

Other versions of this plugin may exist. Please ensure you are viewing the documentation for the version that you are currently using. If you are not running the latest version of your plugin we recommend upgrading. See: list of all available versions of this plugin.

Purpose

This plugin is used to index content from the Instagram social media platform.

The plugin gathers Instagram posts that are linked to a specific user’s account (as allowed by the Instagram tokens) using the Instagram basic display API.

Usage

Create a custom data source

This plugin must be used in conjunction with a custom data source. Before using this plugin ensure you have created a custom data source, then enable the plugin on this data source.

Enable the plugin

Enable the Instagram gatherer plugin on your custom data source from the extensions screen of the administration dashboard or add the following data source configuration to enable the plugin.

plugin.instagram-custom-gather.enabled=true
plugin.instagram-custom-gather.version=1.0.0
This plugin requires a full update of the data source to take effect.

Plugin configuration settings

  • plugin.instagram-custom-gather.encrypted.user-access-token (Required): The user access token for access to the Instagram API. See: how to get an Instagram access token for more information.

This plugin property is encrypted as it is a key to the Instagram data in a given account.
plugin.instagram-custom-gather.encrypted.user-access-token=<INSERT-YOUR-TOKEN-HERE>
  • plugin.instagram-custom-gather.config.media-fields: specifies the media data fields to extract from the given Instagram account. You can customize which data fields could be included during the data gathering process. Each data field is separated by a comma.

By default, the data field values taken are "media_type", "media_url", "timestamp", "caption", "thumbnail_url", "username", "permalink" and "id". If the user does not set up this plugin property.

Example with the default media data fields set is shown below:

plugin.instagram-custom-gather.config.media-fields="media_type,media_url,timestamp,caption,thumbnail_url,username,permalink,id"

Plugin error handling

  • Any instagram gather server connction error: The gather process is aborted with an error message in gather.log as HTTP response code for gathering page 1 from Instagram is [HTTP status Code], where HTTP status code indicates the HTTPS connection issue.

  • Invalid user access token: The gather process is aborted with the same error message indicated for Any Instagram Gather Server connction error. The HTTP status code would be 400 (Bad Request).

  • The retrieved instagram entry does not contain media field, permalink: The gather process will skip this entry and continue with the rest of the instagram data entries but log the error message.

  • The retrieved instagram entry does not contain the data value for the requested media field: The gather process will set the data value as null for the corresponding data field.

Instagram gathered entry example

A gathered Instagram JSON entry from the given Instagram account using the default media field(s) is shown below:

{
        "media_type": "IMAGE",
        "media_url": "https://scontent.cdninstagram.com/v/t51.29350-15/312620827_2776062742527833_1823212135481542642_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=8ae9d6&_nc_ohc=8ii0ELSpHfkAX8HUaCH&_nc_ht=scontent.cdninstagram.com&edm=ANo9K5cEAAAA&oh=00_AfDIJCp9bVzASQEtZPv6aWxQY5r1Oy21ZnZe8Q9DCUqkkA&oe=6367B26C",
        "timestamp": "2022-10-25T06:42:22+0000",
        "caption": "post 8",
        "thumbnail_url": null,
        "username": "testsquizgather",
        "permalink": "https://www.instagram.com/p/CkIIVI0Lc8y/",
        "id": "17852387873847441"
}

User mentions and hash-tags

User mentions and hash-tags within Instagram content can be made searchable by enabling the social tags plugin.

Metadata mappings

Instagram data sources provide a number of Instagram-specific metadata mappings:

Class ID Type Behaviour JSON fields included

instagramAuthor

text

content

username

instagramCaption

text

content

caption

instagramId

text

content

id

instagramMediaType

text

content

media_type

instagramMediaURL

text

content

media_url

instagramThumbnailURL

text

content

thumbnail_url

d

date

(derived from) timestamp

Use the -SF query processor option to access these metadata fields on the search response and in the templates (i.e. -SF=[instagramCaption,instagramThumbnailURL]).

All versions of instagram-custom-gather