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.
Important Note
The version 2 is NOT backward compatible with version 1. Please update the Metadata mapping based on your use case. See Upgrade notes for the upgrade instructions.
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=2.0.0
| This plugin requires a full update of the data source to take effect. |
Enable the JSONToXML filter
This plugin requires the JSONToXML built-in filter to be added to the filter chain.
filter.classes=<OTHER-FILTERS>:JSONToXML:<OTHER-FILTERS>
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 error handling
-
Any instagram gather server connction error: The gather process is aborted with an error message in gather.log asHTTP 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 forAny Instagram Gather Server connction error. The HTTP status code would be 400 (Bad Request). -
The retrieved instagram entry does not contain permalink: The gather process will skip this entry and continue with the rest of the instagram data entries but log in info message.
Instagram JSON
The following fields are returned by the Instagram Basic Display API for each post, please refer to Instagram Basic Display API Document for details.
{
"id": string,
"media_url": url/string,
"media_type": enum, //Can be IMAGE, VIDEO, Or CAROUSEL_ALBUM
"caption": string, //Not available on CAROUSEL_ALBUM
"permalink": url/string, //Will be omitted if the Media contains copyrighted material, or has been flagged for a copyright violation. Funnelback will not index if it is missing
"timestamp": dateTime,
"username": string,
"is_shared_to_feed": boolean, //For Reels only
"thumbnail_url": url/string, //Only available on VIDEO
"children": { //Only available on CAROUSEL_ALBUM
"data": [
{
"id": string
}
]
}
}
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
Default mapping
Only the timestamp is mapped to the meta class d.
| Class ID | Type | JSON fields included |
|---|---|---|
d |
date |
|
Manual metadata mapping
Use the metadata mappings to configure your metadata mappings. Available fields will be listed by viewing the available XML fields.
The -SF query processor option must also be configured on your results page to include these metadata fields in the search response (e.g. -SF=[.....]).
Upgrade Notes
Upgrading to version [2.0.0]
The version 2 is NOT backward compatible with version 1.
Please follow the following instructions to upgrade to version 2.0.0
-
Remove all the version 1 configuration parameters except
plugin.instagram-custom-gather.encrypted.user-access-token. -
Enable the JSONToXML filter as any previous fields defined by default or through the configuration of the
plugin.instagram-custom-gather.config.media-fieldskey are not available. The fields that are available are based on returned responses from the instagram APIs. -
Follow Metadata mappings to map the Instagram JSON to corresponding meta class to match Funnelback Template requirements.