galen / PHP-Instagram-API

PHP 5.3+ wrapper for the Instagram API
338 stars 159 forks source link

Load more button with images #17

Closed mdunbavan closed 11 years ago

mdunbavan commented 11 years ago

Hey Galen,

I have got your Instagram PHP class working okay in my Laravel app.

I wondered how hard it would be to have a load more button in the site with images, say load more images obviously sticking to the Instagram amount every time so 20 loaded through the pagination->next_max_id. I have seen an example of it here https://gist.github.com/cosenary/2961185.

I just wondered how easy it would be with your PHP Library?

Cheers

galen commented 11 years ago

It's very easy

https://github.com/galen/PHP-Instagram-API/blob/master/Examples/user.php#L54

and

https://github.com/galen/PHP-Instagram-API/blob/master/Examples/views/user.php#L66

use getNextMaxId() or getNext()

mdunbavan commented 11 years ago

Ah I saw that and its implemented perfectly but what I meant was having it load into the same page?

galen commented 11 years ago

Create a page that takes a user id and a next max id and gets the next images. Then its as simple as using AJAX to query that page and pass the user id and next max id.

mdunbavan commented 11 years ago

okay I will try that then. Cheers.

One more question about the instagram class. When I like an item or unlike an item I get a huge array of data spat out on the page, no errors just the data.

Screen Shot 2013-04-24 at 09 53 34

Is this an error in the core of the class app?

galen commented 11 years ago

It's an exception being thrown. Read the exception and youll see it's because youre passing an invalid media id

mdunbavan commented 11 years ago

Hi Galen,

Yes I eventually figured that out and fixed it, starting to get my head around this now.

Can the like be implemented in a simpler way with images from tags?

I have this form: https://github.com/mdunbavan/everydayflk/blob/master/application/views/home/index.blade.php

This is where the like button is and it seems to work intermittently for some reason.