开发者

How can I generate a thumbnail of a web page for a facebook post?

开发者 https://www.devze.com 2023-02-24 21:11 出处:网络
My app is posting to users\' Facebook walls, and linking to a page they have created.The page is in html.I\'d like to be able to put a thumbnail of the page as the image on the wall post.I\'m not sure

My app is posting to users' Facebook walls, and linking to a page they have created. The page is in html. I'd like to be able to put a thumbnail of the page as the image on the wall post. I'm not sure whether 开发者_如何转开发this is possible or not. Anyone have any ideas?

If it helps, the page itself is stored as a series of 'elements'... for each one, I know the size and position of the element, and the content (which may be text or an image). So I can pull all that in from the database.

I guess it would be sufficient to create a thumbnail using php at the point when the user clicks 'Publish This to my wall', if that's easier than doing it on the fly - I can save the image and then link to it.

Any ideas?


I create thumbnails for my site using CutyCapt, which works very well indeed on both Windows and Linux. You can use exec to invoke this from php.

There are also web services that allow you a quota of free thumbnail snapshots, that are easy to integrate into your website. e.g.

http://www.websnapr.com/

or

http://webthumb.bluga.net/home


I figured out how to do this. I used the PHP gd library, which allows you to create a base image and then add images and text. Works pretty well.

0

精彩评论

暂无评论...
验证码 换一张
取 消