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

Specific story's thumbnail

Open selimonline opened this issue 11 years ago • 10 comments

Dear,

The code for specific story's thumbnail ...... $data = $snapchat->getStoryThumb('[story_media_id]', '[story_key]', '[thumbnail_iv]'); For a common story, [story_key] is absent. I have used here media_key instead of story_key. Is this right? But still I am not getting any results for thumbnail. It returns like this 87Áäÿa)ßkä„ÙEËe»eØm"Œ%JÁþó§|gÅëðâaÛdתv„_Ó{óPN»i =‡ýä³X¯PŽ*ä23¾SræS¨}ŒI&;ÅÈÆ\òkf¸ñU¬

What should I do now?

selimonline avatar Sep 08 '14 17:09 selimonline

Did you try $snapchat->getFriendStories()?

hako avatar Sep 08 '14 18:09 hako

Ya, I have tried on $snapchat->getFriendStories().

selimonline avatar Sep 08 '14 18:09 selimonline

That's odd, I managed to get the story thumbnail using that function. it seems that 'garbage' string above might look like the output of the thumbnail.

Try to save the result as a .png using file_put_contents() or am I missing something?

hako avatar Sep 08 '14 18:09 hako

I am really not clear about your message. Suppose, I have all data of a feed/story(like: id, media_id, thumbnail_iv). How can I get that story's thumbnail?

selimonline avatar Sep 08 '14 19:09 selimonline

From the function $snapchat->getFriendStories() you will get all the stories on the feed. if you use var_dump() you can see the following:

media_id media_key thumbnail_iv

Put them in$snapchat->getStoryThumb(media_id, media_key, thumbnail_iv) For example, the following code will get the first friend story's thumbnail.

$s = new Snapchat("username","password");

$story =  $s->getFriendStories();

$data = $s->getStoryThumb($story[0]->media_id, $story[0]->media_key, $story[0]->thumbnail_iv);

file_put_contents('thumbnail.png', $data);

I hope this helps.

hako avatar Sep 08 '14 20:09 hako

Thanks a lot for your support. I am trying and will update you very soon

selimonline avatar Sep 08 '14 20:09 selimonline

As per your previous message. I am using very old version. Can you please send latest API zip file with functions declaration? I will be too much grateful to you.

Thanks in advance Salim

selimonline avatar Sep 08 '14 20:09 selimonline

Here: https://github.com/JorgenPhi/php-snapchat/archive/master.zip

(The download link is also on the front page of the repo)

hako avatar Sep 08 '14 21:09 hako

Thanks for response. But I downloaded exactly this files. Here many functions may be old. That's why, I asked for newer one. Like the functions you provided me..... $data = $s->getStoryThumb($story[0]->media_id, $story[0]->media_key, $story[0]->thumbnail_iv); file_put_contents('thumbnail.png', $data);

This is absent there. Any way, I used the above function, have been success to create image. But it's a blank image(fully black). My code is here.

$snapchat = new Snapchat('my_username', 'my_password'); $story = $snapchat->getFriendStories(); $data = $snapchat->getStoryThumb($story[0]->media_id, $story[0]->media_key, $story[0]->thumbnail_iv); file_put_contents('/home/webmaruf/public_html/pst1/snapchat/uploads/thumbnail.png', $data);

I know, I am disturbing you so much. Sorry for that.

Thanks

selimonline avatar Sep 09 '14 06:09 selimonline

Dear, one more help please...... I have media_url and thumbnail_url for friends feeds. May I print thumbnail from this. Then how?\

Thanks in advance Salim

selimonline avatar Sep 17 '14 06:09 selimonline