Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific story's thumbnail #45

Open
selimonline opened this issue Sep 8, 2014 · 10 comments
Open

Specific story's thumbnail #45

selimonline opened this issue Sep 8, 2014 · 10 comments

Comments

@selimonline
Copy link

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?

@hako
Copy link
Collaborator

hako commented Sep 8, 2014

Did you try $snapchat->getFriendStories()?

@selimonline
Copy link
Author

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

@hako
Copy link
Collaborator

hako commented Sep 8, 2014

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?

@selimonline
Copy link
Author

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?

@hako
Copy link
Collaborator

hako commented Sep 8, 2014

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.

@selimonline
Copy link
Author

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

@selimonline
Copy link
Author

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

@hako
Copy link
Collaborator

hako commented Sep 8, 2014

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

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

@selimonline
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants