Facebook RSS Feed big image - facebook

Helle every one,
I'm currently working with a Facebook page RSS feed and I need to retrieve images on it.
the problem is that those images are just thumbnail. I would like to donwload the big one.
For exemple I have these feed : https://www.facebook.com/feeds/page.php?id=126044397444435&format=rss20
I have this image on the feed : https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/393656_257350694313804_126044397444435_712409_344887174_s.jpg
But I would like this one : https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s320x320/393656_257350694313804_126044397444435_712409_344887174_n.jpg
How can I solve this problem ?
Thanks !

Look at the URLs
https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/393656_257350694313804_126044397444435_712409_344887174_s.jpg
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s320x320/393656_257350694313804_126044397444435_712409_344887174_n.jpg
The subdomain for the large image is fbcdn-sphotos-a instead of fbcdn-photos-a, it has a s320x320 directory name inserted before the filename, and the filename is suffixed with _n instead of _s
The 320x320 is a max size, the following url returns the image at 480 px height
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s480x480/393656_257350694313804_126044397444435_712409_344887174_n.jpg

Related

How are text images processed by Facebook?

This code is processed as goku image on FB chat:
[[236823566443944]][[236823583110609]][[236823586443942]][[236823596443941]][[236823609777273]]
[[236823629777271]][[236823636443937]][[236823649777269]][[236823663110601]][[236823673110600]]
[[236823683110599]][[236823686443932]][[236823696443931]][[236823699777264]][[236823709777263]]
[[236823716443929]][[236823733110594]][[236823736443927]][[236823749777259]][[236823753110592]]
[[236823756443925]][[236823759777258]][[236823769777257]][[236823779777256]][[236823783110589]]
[[236823789777255]][[236823793110588]][[236823796443921]][[236823806443920]][[236823809777253]]
How FB creates image from this? I found the code on symbols-n-emoticons in comments below, copied&pasted into FB chat and - black magic - the image was there.
So I took your example and did some testing. If yout right click on the image in chat and look at it URL, you can find following:
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/227547_236823636443937_1841629131_n.jpg
It's one tile from the goku image. The middle part of the URL corresponds to one value in you code. So this code are actually shortcuts to images stored on FB servers, and the chat window simply replaces the code with image.
I think it could be due to latest update in FB, which allows you to attach images directly to posts.
[EDIT]
I have tried several other images and it worked for all images hosted akamaihd.net aka Facebook hosting. Just grab the secod number and past it in chat in double brackets.
The image is always resized to 16x16px, hence the code for Goku is so long, it's actually made from tiles.

Facebook Share Dialog image doesn't show

I'm using the Facebook Share Dialog (https://developers.facebook.com/docs/reference/plugins/share-links/) and the image doesn't appear. I've checked a lot of posts here in SO an other forums but couldn't find a solution
I found this site where Share Dialog works correctly: http://election.gv.my/ (They don't use meta property="og:image")
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http%3A%2F%2Felection.gv.my%2F&p[images][0]=http%3A%2F%2Felection.gv.my%2Fassets%2Fcombined.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28
If I use its image in my code, it shows:
var sharer = "https://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + shareURL + "&p[images][0]=" + "http://election.gv.my/assets/combined.jpg" + "&p[title]=" + shareTitle + "&p[summary]=" + shareExcerpt;
If I use my image in its code it doesn't:
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://election.gv.my/&p[images][0]=http://mysite.com/app/wp-content/uploads/2013/03/poster.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28
The only reason I can think of is something in the server configuration. I've checked my url (website & image) in https://developers.facebook.com/tools/debug and the results are OK, at least the same as that site
The problem in my case was image sizes generated by WordPress:
NO: 85x85, 96x54, 166x94, 170x96, 193x108, 711x400
YES: 356x200, 360x124
https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/
og:image – This is an image associated with your media. We suggest that you use an image of at least 200x200 pixels. However, bigger is better, so if you have a 1500x1500 image that you can use, please use it. We'll downsample and crop it for for people using smaller-resolution devices but will use it on a larger device. The larger this image is, the more likely it will be used when sharing stories on Facebook. (Note: image sizes must be no more than 5MB in size.)
But this doesn't explain why size 356x200 is ok but no 711x400 wich is bigger and has the same aspect ratio
Try reducing the file size: I changed from 56 to 24 and it then loaded.
Try adding a second "&" before "p[images][0]" => "&&p[images][0]"

Selecting photo id, small_src from a certain album

I would like to get the ids and thumbnail image sources of pictures belonging to a certain album.I have the user_photos permission and the album_id is that of the app_user.
So far, I have tried:
https://graph.facebook.com/<album_id>?fields=photo&access_token=...
^Returns too much data like comments and tags and whatnot. I'd like to avoid that.
And FQL:
SELECT pid,src_small FROM photo WHERE aid="album_id"
url:
https://graph.facebook.com/fql?q=SELECT+pid,src_small+FROM+photo+WHERE+aid=" <album_id>"&access_token=...
Gets an empty result.
I'm planning to write an ajax photo-selector to work with my app :(
According to https://developers.facebook.com/docs/reference/fql/photo/
"src_small" -> The URL to the thumbnail version of the photo being queried. The image can have a maximum width of 75px and a maximum height of 225px. This URL may be blank.
Maybe you can try "images" instead.
For example,
SELECT pid,images FROM photo WHERE aid="album_id"
Then select one url by size range of the photo you need.

How to handle correctly converting images to thumbnails

I'm building out an admin area for an ecommerce site where the user can create a new product and upload multiple images to be used for the product. I have a table that lists all of the products, each row shows the first image returned from the database. I can scale down a large image to 100px x 100px but the user is still downloading a big image, not a true thumbnail.
I see two ways of doing this:
1. I can make the user choose which img will be the thumbnail so that the regular img is upload and also a smaller version of the file.
2.I can create thumbnails for every img that is uploaded and append to the filename of the thumbnail img so that I can return the first image that ends with a certain string.
Is there a more elegant way to do this or am I on the right track?
Create a cache directory, then create a script called something like image.php. Link your images like this
<img src="image.php?path=images/img.png&width=100&height=100">
Then in image.php, it should first check in the cache directory if the file exists.
Call the file "img.png&width=100&height=100" and save it in the cache directory. That way you can easily check if it exists, but there is enough entropy for someone to change it to width=101 and height = 101 so that the image will be regenerated.
Each time you create the thumbnail, just store it in the cache directory. If it exists, do a header() call and an echo file_get_contents() and then die().

how to show thumbnil image from youtube rss feed in iphone

I tried To Parse the response of the of the youtube RSS feed and displayed it in tableview...
I works fine except i can't fetch URL for the thumbnil image of the video from rss... It comes in description tag and inside description tag there is a whole div (html)... is there any simpler way example tutorial.....to fetch the thumbnil image from youtube rss...
Thanks
i have the same prob ,but have figured out with YOUtube API ,
make your feed url in this pattern
http://gdata.youtube.com/feeds/base/users/[INSERT USERNAME]/uploads
after in the generated xml there is a media:thumnail tag where u can used to display youtube thumnails images.
without using this format u will get a descr tag with div style image thumbnail quite hard to parse as it is a html part,
better try this,i have solved this using type of feed pattern