php-snapchat icon indicating copy to clipboard operation
php-snapchat copied to clipboard

getSnaps

Open Voiceeeeee opened this issue 9 years ago • 13 comments

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

Voiceeeeee avatar Jan 02 '15 13:01 Voiceeeeee

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

liamjack avatar Jan 02 '15 13:01 liamjack

Is there a workaround for this?

Voiceeeeee avatar Jan 02 '15 13:01 Voiceeeeee

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.

liamjack avatar Jan 02 '15 13:01 liamjack

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?

Voiceeeeee avatar Jan 02 '15 14:01 Voiceeeeee

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.

liamjack avatar Jan 02 '15 14:01 liamjack

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.

Voiceeeeee avatar Jan 02 '15 14:01 Voiceeeeee

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

liamjack avatar Jan 02 '15 14:01 liamjack

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.

Voiceeeeee avatar Jan 02 '15 14:01 Voiceeeeee

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

liamjack avatar Jan 02 '15 14:01 liamjack

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

Voiceeeeee avatar Jan 02 '15 14:01 Voiceeeeee

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.

liamjack avatar Jan 02 '15 15:01 liamjack

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?

Voiceeeeee avatar Jan 02 '15 17:01 Voiceeeeee

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.

liamjack avatar Jan 02 '15 20:01 liamjack