Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
oui_instagram - Display Instagram user infos and recent images
It is strongly recommended you employ a cache plugin or system to avoid too many external queries.
Plugin tags work more or less like txp images tags.
The plugin uses oui_insta_
instead of oui_instagram_
prefix from v1.0.0 for shorter tag names.
<txp:oui_insta_images />
or
<txp:oui_insta_images username="cercle_magazine">
<txp:oui_insta_image_url>
<txp:oui_insta_image />
</txp:oui_insta_image_url>
<txp:oui_insta_image_info /><br />
<txp:oui_insta_image_author />, <txp:oui_insta_image_date />
</txp:oui_insta_images>
Last edited by NicolasGraph (2017-01-25 14:28:43)
Offline
Re: oui_instagram - Display Instagram user infos and recent images
Offline
#3 2016-04-26 13:31:50
- johnno
- Member
- Registered: 2007-06-14
- Posts: 30
Re: oui_instagram - Display Instagram user infos and recent images
This could be very useful – thanks Nicolas!
But I’m getting these errors with v0.6.3 in Textpattern 4.5.7:
Warning: file_get_contents(https://api.instagram.com/v1/users/search?q=myusername&access_token=xxxx.xxx): failed to open stream: HTTP request failed! HTTP/1.1 400 BAD REQUEST while parsing form None on page news
Textpattern Notice: oui_instagram was unable to find the user id of the following instagram username: myusername while parsing form None on page news
The 400 bad request is:
OAuthPermissionsException”,“code”:400,“error_message”:“This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions.
Any thoughts?
Thanks
Offline
Re: oui_instagram - Display Instagram user infos and recent images
johnno wrote #298832:
Any thoughts?
Could you try to get a new access token from here and let me know if it works?
Edit: by using the username
attribute you need an access token authorized in the public_content scope to allow the plugin to get your user id (the link above should do the trick). Nevertheless, the last plugin version allows you to directly provide a user id via the user_id
attribute; it is faster than username
and doesn’t require any special login permission. If you can get your user id here or elsewhere, I recommend the use of this attribute…
Last edited by NicolasGraph (2016-04-26 20:11:31)
Offline
#5 2016-04-26 22:15:35
- johnno
- Member
- Registered: 2007-06-14
- Posts: 30
Re: oui_instagram - Display Instagram user infos and recent images
Thanks Nicolas – that worked perfectly.
My mistake was attempting to create the access token from within the Instagram account (but shouldn’t that work anyway?)
I upgraded from v0.5.9 because a limit of only 33 Instagram images were being pulled onto my website, despite requesting 100. Since this problem has not been resolved by using v0.6.3 I conclude that the problem lies elsewhere – I guess within the Instagram API?
BTW your frenglish is infinitely superior to my Engçais!
Offline
Re: oui_instagram - Display Instagram user infos and recent images
johnno wrote #298839:
Thanks Nicolas – that worked perfectly.
Great!
My mistake was attempting to create the access token from within the Instagram account (but shouldn’t that work anyway?)
By default Instagram gives you an access token with a basic scope which is not enough to get the user id from the username
attribute but should be enough to pull your images with the use of the user_id
attribute, I’ll try to improve the plugin or at least the help file.
I upgraded from v0.5.9 because a limit of only 33 Instagram images […] I conclude that the problem lies elsewhere – I guess within the Instagram API?
Right, I didn’t try to pull as many images for now but it seems that the only way to pull more images is to throw several requests: see here. I’ll see if I can do something for the next version; no warranty…
BTW your frenglish is infinitely superior to my Engçais!
Merci ! :D
Offline
#7 2016-04-27 09:03:02
- johnno
- Member
- Registered: 2007-06-14
- Posts: 30
Re: oui_instagram - Display Instagram user infos and recent images
Yes, I had another go at using the default Instagram access token – this time with the user_id
attribute – and it does work…with a 20 image limit of course.
Anyway…thanks for your work thus far :)
Offline
Re: oui_instagram - Display Instagram user infos and recent images
johnno wrote #298850:
Yes, I had another go at using the default Instagram access token […] and it does work…with a 20 image limit of course.
The login permission also affect the max images count? I didn’t notice that; interesting…
Offline
Re: oui_instagram - Display Instagram user infos and recent images
Let me introduce oui_instagram-v.0.6.4.
See this related topic to know more about the use of plugin prefs as default values for attributes.
Last edited by NicolasGraph (2016-04-27 12:05:35)
Offline
Re: oui_instagram - Display Instagram user infos and recent images
@Johnno; would you like to try this? It’s not as clean as it could yet but it kicks out the limit of 20/33 images…
Last edited by NicolasGraph (2016-04-27 19:19:23)
Offline
#11 2016-04-28 20:11:55
- johnno
- Member
- Registered: 2007-06-14
- Posts: 30
Re: oui_instagram - Display Instagram user infos and recent images
Hmm…
Interesting results on an Instagram account with 41 images:
limit > 20 gives an error
limit = 21 shows first 20 then repeats first image
limit > 22 shows first 20 then repeats required number
limit > 33 shows first 20 then repeats required number
limit = 41 shows first 21 then repeats first image
limit = 42 shows first 22 then repeats first and second image
limit = 43 shows first 23 then repeats first, second image and third image
etc
Getting there!
Offline
Re: oui_instagram - Display Instagram user infos and recent images
johnno wrote #298873:
Hmm…
Ok, sorry, there is also a problem with the cache. It needs more work but I’ll get it.
Last edited by NicolasGraph (2016-04-28 22:11:24)
Offline