Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-03-13 15:17:07

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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>

Informations | Download

Last edited by NicolasGraph (2017-01-25 14:28:43)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#2 2016-04-20 11:44:17

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_instagram - Display Instagram user infos and recent images


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

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

#4 2016-04-26 14:49:17

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

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

#6 2016-04-27 08:26:49

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

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

#8 2016-04-27 09:37:26

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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…


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#9 2016-04-27 11:24:26

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#10 2016-04-27 18:05:05

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

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

#12 2016-04-28 20:26:13

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB