alexm Posted October 7, 2016 Share Posted October 7, 2016 Ahhhh, you know what it could be! I am currently using hosts file to point a domain to another IP address so the rediercts url will be hitting a different server! Do you think that is it? Is there any work around whilst I'm in development to get this working on the server I am on? Link to comment Share on other sites More sharing options...
Tom. Posted October 18, 2016 Share Posted October 18, 2016 I keep getting the following error - [InstagramFeed]: No user '' was found. However it's working fine. Link to comment Share on other sites More sharing options...
dotnetic Posted October 18, 2016 Share Posted October 18, 2016 @justb3a Is it only possible to retrieve the recentMedia of the sandbox user? EDIT: To clarify: Can I just access images of the access token user or can I get images from every user? I get the images of my own account (which is in sandbox mode) but if I enter something diffent in the field "Username" in the modules settings, I still get the same images and not the images of the other user. I even tried $instagram = $modules->get('InstagramFeed')->getRecentMedia("cocacola"); but still my own images appear. I also tried clearing the cache via the link in the modules setting. Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 19, 2016 Share Posted October 19, 2016 The sandbox api is limited to sandbox users everywhere, so even retrieving by tag does only show images of those. You cannot get any other users media. 1 Link to comment Share on other sites More sharing options...
Matt_P Posted January 27, 2017 Share Posted January 27, 2017 Hi everyone, This is a great module. I was just wondering if anyone knows whether it would be possible for me to pull the location of each Instagram post and if so what the correct call is? Thanks, Matt Link to comment Share on other sites More sharing options...
justb3a Posted January 28, 2017 Author Share Posted January 28, 2017 @Matt_P If you use the `getRecentMedia()` endpoint you should be able to access the location inside the foreach loop. Have a look at the instagram api, expand the response and there you'll see an example response containing all data which will be returned including a location entry. "location": { "latitude": 37.778720183610183, "longitude": -122.3962783813477, "id": "520640", "street_address": "", "name": "Le Truc" } Code example (not tested): <?php $feed = $modules->get('InstagramFeed')->getRecentMedia(); ?> <div class="instagram"> <?php foreach ($feed as $media): ?> // check if location is not `null` <?php if ($location = $media['location']): ?> Location: <?= $location['name'] ?> <?php endif; ?> <?php endforeach; ?> </div> 1 Link to comment Share on other sites More sharing options...
Matt_P Posted January 28, 2017 Share Posted January 28, 2017 Thanks justb3a, Works like a charm. Link to comment Share on other sites More sharing options...
Tanky Posted February 5, 2017 Share Posted February 5, 2017 Hi everyone, Do you think it would be possible to save the last 20 or so medias (due to instagram sandbox mode), as if they would have been uploaded on the site? In order for them not to disappear when the new posts arrive. Mainly, the idea would be to have the complete feed displayed. I did it manually with the medias urls for now but they keep changing so it's not a very suitable solution… Thanks Link to comment Share on other sites More sharing options...
justb3a Posted February 6, 2017 Author Share Posted February 6, 2017 hi @Tanky you could add an image field to your page and save the image there. Try something like the following: $page->of(false); $page->images->add($media['images']['standard_resolution']['url']); $page->save("images"); Link to comment Share on other sites More sharing options...
Tanky Posted February 8, 2017 Share Posted February 8, 2017 Thank you very much! I'll try this out and let you know. Link to comment Share on other sites More sharing options...
Tanky Posted February 9, 2017 Share Posted February 9, 2017 I pasted your code in the foreach that I use to generate each media of the feed: $page->setOutputFormatting(false); $page->insta_image->add($media['images']['standard_resolution']['url']); $page->save("insta_image"); It returns me this error, which is weird because you already disabled the output formatting: Error: Exception: Can't save field from page 1: /: Call $page->setOutputFormatting(false) before getting/setting values that will be modified and saved. [insta_image] (in /home/tenutaxyit/www/wire/core/PagesEditor.php line 783) And there is something else I thought about, each time someone will load the page the images will be saved again, so how could I check if a media is already backed up before saving it? Link to comment Share on other sites More sharing options...
justb3a Posted February 15, 2017 Author Share Posted February 15, 2017 @Tanky Sorry, I have not the time at the moment to try this myself. But this is more a general topic, please try to use the forum search, I know there are a lot of topics which cover how to add an image via api. If you want to have an "archive"/Feed of all images/posts, you should consider to decouple the process of saving images from displaying it on the webpage. I would set up a cronjob or something like this which "asks" repeatedly at certain time intervals whether there are new posts. Then you could add a new Page / Page-Table-Item / Repeater-Item (it's up to you how to save it) containing the image and all the desired data (location, comments, ..) as well as the id (`$media['id'|`). Simply check if you already have an item with that id. You could also check whether `$media['created_time']` is greater than the last inserted item. Or even better: the endpoint supports additional parameters which could be implemented as well: MAX_ID Return media earlier than this max_id. MIN_ID Return media later than this min_id. Using MIN_ID you should be able to only receive new posts/images. Link to comment Share on other sites More sharing options...
Tanky Posted February 15, 2017 Share Posted February 15, 2017 I'm gonna try to find a solution by myself. Thank you for the advises! Link to comment Share on other sites More sharing options...
arjen Posted February 18, 2017 Share Posted February 18, 2017 On 18/10/2016 at 2:42 PM, Tom. said: I keep getting the following error - [InstagramFeed]: No user '' was found. However it's working fine. Hi @Tom., did you solve this? It is working fine, but the the error keeps popping up. I commented out line #317 of InstagramFeed.module to stop the logging for now. Link to comment Share on other sites More sharing options...
alexm Posted November 9, 2017 Share Posted November 9, 2017 Here's a question. is there a way of setting the imageCount value when initialising the module. I don't think there is taking a look at the modules methods but perhaps I'm wrong? This might be handy in the instance where you want to have one page show say 4 images and another show 8. I know you could do this when iterating and limit but might be able to set limit based on each instance of the instagram feed? Link to comment Share on other sites More sharing options...
justb3a Posted November 9, 2017 Author Share Posted November 9, 2017 There you go: <?php $feed = $modules->get('InstagramFeed')->setImageCount(8)->getRecentMedia(); ?> 2 Link to comment Share on other sites More sharing options...
alexm Posted November 10, 2017 Share Posted November 10, 2017 Oh, well I stand corrected! That's just awesome. thank you @justb3a Link to comment Share on other sites More sharing options...
alexm Posted November 10, 2017 Share Posted November 10, 2017 Ah you added the method. That's brilliant. Thanks again. Link to comment Share on other sites More sharing options...
dab Posted January 11, 2018 Share Posted January 11, 2018 Has any one noticed a problem with Instagram posts with multiple images not showing? I get the output: // output video suggesting that "multiple image" posts are not picked up as media type "image". <?php if ($media['type'] === 'image'): ?> With thanks... Link to comment Share on other sites More sharing options...
dab Posted January 12, 2018 Share Posted January 12, 2018 Found a fix for posts with multiple images... Replace // output video with: <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> e.g. <div class="instagram"> <?php foreach ($feed as $media): ?> <?php if ($media['type'] === 'image'): ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> <?php else: ?> <a href="<?=$media['link']; ?>" class="instagram-item"> <picture> <source media="(min-width: 55rem)" srcset="<?=$media['images']['standard_resolution']['url']; ?>"> <source media="(min-width: 45rem)" srcset="<?=$media['images']['low_resolution']['url']; ?>"> <source srcset="<?=$media['images']['thumbnail']['url']; ?>"> <img src="<?=$media['images']['thumbnail']['url']; ?>" alt=""> </picture> </a> <?php endif; ?> <?php endforeach; ?> </div> Link to comment Share on other sites More sharing options...
alexm Posted March 13, 2018 Share Posted March 13, 2018 Does anyone know if it's possible to get the standard resolution image as square rather than non-square at all? Link to comment Share on other sites More sharing options...
J Cat Posted April 17, 2018 Share Posted April 17, 2018 Is there any plans to update this to work with new instagram Graph API, as the plugin stopped working as support for the /users/{id}/media/recent has been deprecated as of the 4th April 2018 Link to comment Share on other sites More sharing options...
j00st Posted June 13, 2018 Share Posted June 13, 2018 Cool to have a Module set up for this @justb3a! Cheers! ? I've been reading the topic, but still have a question – not so much about the implementation, but more in options I guess; In understand that it's connected to Sandbox users, but as I'm filling in one user, I take it it's not possible to fill in multiple users? (either in the module-field, or chained in the getRecentMedia('user1, user2')? ...Just wondering, as I'm working with a collective that has multiple accounts. Link to comment Share on other sites More sharing options...
Marco Ro Posted June 14, 2018 Share Posted June 14, 2018 I see this notice: [InstagramFeed]: No data was received for 'nome_user' (recentmedia). [InstagramFeed]: No user 'nome_user.it' was found. I use the correct user name and I checked all the keys access and these are correct, also the token. I saw that the account registered the permission to use my app. So, I don't know maybe I miss something... What I can check ? FIXED: In the end I find that if I disable implicit OAuth and not force the signed requests everything works well. btw I don't know if is a good things! UPDATE: I still see this error in the log page every time some one visit the page: [InstagramFeed]: No user 'xxx' was found. The page work well, but why I see this error and how I can delete it? Thank you Link to comment Share on other sites More sharing options...
alexm Posted June 28, 2018 Share Posted June 28, 2018 Is there a way to get media with a certain tag limited to one user with this module. Have tried chaining getRecentMediaByTag() but I don't think that's possible. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now