简体   繁体   中英

Facebook page feed and photo

I want to show in my home the last feed of my Facebook page, I'm then hooking at this link: https://www.facebook.com/feeds/page.php?id=204770913907&format=json The problem is that facebook provides images in this format: https://www.facebook.com/photo.php?fbid=10151523034618908&set=a.10150426023073908.381002.204770913907&type=1

And then I'm trying to convert them in direct jpg format, but the variables listed in the link above does not help to make up what should be the following link: https://fbcdn-sphotos-ga.akamaihd.net/hphotos-ak-ash3/733911_10151523034618908_777095662_n.jpg

How can I do it?

Use a regexp to get the image from the content field

    preg_match('/.*(class="img" src=")([^"]+)(".*)/',$test,$matches);
echo $matches[2]; //img

Or use the facebook api to get your picture

http://developers.facebook.com/docs/reference/api/using-pictures/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM