Sharon
Sharon

Reputation: 3909

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

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?

Upvotes: 1

Views: 1719

Answers (2)

Sharon
Sharon

Reputation: 3909

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.

Upvotes: 0

Steve Mayne
Steve Mayne

Reputation: 22808

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

Upvotes: 1

Related Questions