February 29, 2008

Embed Scribd iPaper in Grazr Demo

When iPaper launched a couple of weeks ago, I thought it looked like an ideal fit for Grazr, to go along with audio and video embedding (e.g. Youtube Playlists and Related Videos, (and Neulio) All Mixed Up With Yahoo Pipes and Grazr Goodness) and Slideshare embedding (Viewing Presentations in Grazr via Slideshare RSS Feeds).

My thinking was, if a feed contains a PDF as an enclosure, Grazr could take the liberty of embedding it in the Grazr view.

Anyway, just to check that Grazr could handle the embedding just from the 'can I embed iPaper in Grazr anyway?' point of view, I put together a minimal OPML feed containing an (escaped) iPaper embed script in an OPML outline text element... and of course, it works fine :-)


In order to write a quick script to take an RSS feed with PDF enclsoures and links and produce and OPML variant of that feed contining the embedded documents, we need a way of getting a URL to the iPaper representation of a PDF from the PDF URl - and it looks like the scribd.Document.getDocFromUrl API call will do just that in a Javascript context (ref: Scribd Platform Documentation - iPpaer Javascript API; thanks, Jason :-)

What I want to do though, is write a quick PHP script that will get the doc id from a URL, that I can then paste into an escaped embed code in a generated OPML file. The full iPaper API offers a docs.uploadFromUrl call which looks promising, but I wonder what happens on the backend? Does it look to see if the document has already been uploaded, and if so just returns the doc id? Or does it always upload the pdf? Or would a separate  docs.checkIfAlreadyUploadedFromURL call be useful, that passes back the doc id if it's already there?

PS I notice there's an experimental PHP wrapper for the iPaper API, so I'll try and find time to give it a go over the weekend... Unless the Grazr folks get iPaper embedding working 'natively' in Grazr  first, of course... ;-)

Blogged with Flock

Tags: , , ,

Posted by ajh59 at February 29, 2008 01:31 PM
Comments