JorgenPhi / php-snapchat

A PHP library for the Snapchat API - With Commit History
MIT License
259 stars 73 forks source link

getSnaps #71

Open Voiceeeeee opened 9 years ago

Voiceeeeee commented 9 years ago

When using getSnaps();, not all delivered snaps are retrieved, only about 30 ones are, how is that avoidable?

liamjack commented 9 years ago

It's the same for the client, only the latest 30 snaps are displayed, the rest "dissapear".

Voiceeeeee commented 9 years ago

Is there a workaround for this?

liamjack commented 9 years ago

No it's the server that automatically prunes the list. You could workaround it locally by saving the snaps to a database everytime you get all updates, the database would contain all the snaps since using the new system.

Voiceeeeee commented 9 years ago

So basically it'll be API->database->user? Every time a snap isn't in the database it gets inserted to the database and the code fetches & loads the snaps from the database? What about the snaps already gone? Could I mark them as opened and retrieve only the delivered ones or the server will retrieve all but only echo delivered ones?

liamjack commented 9 years ago

Exactly that. Well you can't know about any snaps sent more than 30 snaps ago. If someone creates their account using this system then all of their snaps will be in the system, if someone logs in after having previously used snapchat outside of this system for more than 30 snaps then you will not be able to obtain the full list of snaps received / sent by that user.

Voiceeeeee commented 9 years ago

Hmm, okay, that sucks but you gotta do what you gotta do, gonna stop working on this right now.

Another question, I don't feel like starting another issue, so, is it possible to retrieve the info of a specific snap via it's ID?

Thanks.

liamjack commented 9 years ago

I don't think so, the only info you can get is from /updates

Voiceeeeee commented 9 years ago

But getSnaps loops through the updates, wouldn't it be possible to loop it around one ID and retrieve the other data? It's worth a try IMO.

liamjack commented 9 years ago

I don't understand what you're trying to do here.

Voiceeeeee commented 9 years ago

Let's say I want to retrieve the media_type of a specific snap that I have it's ID, is that possible?

liamjack commented 9 years ago

Only if the snap is for you and if it is in the last 30 snaps, you just have to parse getSnaps data until you find the id.

Voiceeeeee commented 9 years ago

Are you sure it has to be in last 30? Afterall getMedia doesn't need to be in past 30 so I'm not sure why this would, I'm talking about writing a new function named getSnap.

Question, can I open a snap using the Snapchat app after I receive 30 other snaps?

liamjack commented 9 years ago

I haven't tried but I would think it is possible.

On 02/01/2015 18:00, Voiceeeeee wrote:

Are you sure it has to be in last 30? Afterall getMedia doesn't need to be in past 30 so I'm not sure why this would, I'm talking about writing a new function named getSnap.

Question, can I open a snap using the Snapchat app after I receive 30 other snaps?

— Reply to this email directly or view it on GitHub https://github.com/JorgenPhi/php-snapchat/issues/71#issuecomment-68542161.