forked from remi/pubwich
-
Notifications
You must be signed in to change notification settings - Fork 27
ServiceInstagram
Michael Haschke edited this page Aug 6, 2017
·
4 revisions
The Instagram service aggregates the recent media from a Instagram user profile.
-
method: either
InstagramApiData
orInstagramProfileData
- username: your Instagram username
... and the basic configuration for all services.
-
access_token: the access token of your instagram client authorized by your Instagram user:
- Create your your Instagram client (it's easy to register one).
- Add a redirect URL under the security options (use a URL that you control, e.g. your homepage or the URL you use for your PubwichFork installation) and allow implicit OAuth.
- Use the implicit OAuth workflow of Instagram:
https://api.instagram.com/oauth/authorize/?client_id=YOUR-CLIENT-ID&redirect_uri=YOUR-REDIRECT-URI&scope=basic+public_content&response_type=token
- use the access token from
YOUR-REDIRECT-URI#access_token=YOUR-ACCESS-TOKEN
Using a client in API sandbox mode, you will be able to access the last 20 media of any sandbox user that grants you permission.
- no other options
You only have access to the last 12 public media of the profile with the configured username.
$instagram = array(
'Instagram', 'instagram', array(
'method' => 'InstagramApiData',
'username' => 'username', // from https://instagram.com/username/
'access_token' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'total' => 8,
'title' => 'Instagram',
'description' => 'recent media'
)
);
- date: info about publishing time
- title: given media title (first line of the media description)
- link: URL of the Instagram page of the media
- thumbnail: URL of the preview thumbnail
- description: the full media description
<li>
<a title="{{{title}}}" href="{{{link}}}">
<img src="{{{thumbnail}}}" alt="{{{title}}}" height="75" />
</a>
</li>