Friday, August 7, 2009

Them pesky web serviceses...

It always stuck me as a little odd that you have specific applications to upload to flickr, another little app with a cute interface for throwing video files at webserviceY etc. I should also mention that all of this is coming to the maemo build shortly... what better place to unlock web services than a tablet or phone, neh?

What ever happened to the unix philosophy, "everything is a file". Then you could just "cp" to flickr, write your facebook status in bash or C-x C-s your mood to facebook://status.

I added some support for the flickr API to ferris last year, and the recent 1.3.5 release expands that and adds more web service goodness. But, which of these nasty, closed source services should be supported? The answer: it doesn't matter, there just filesystems! Of course, I'd prefer to mount a FOSS, GNU, Free, Privacy respecting server, and who wouldn't.. but for some things you want to just cp to youtube and forget about it.

For facebook I have three objects at facebook:// level. A status file which is read/write, a recent directory which shows the feed of stuff your chums are up to, and a contacts directory with virtual vcard files for your pals. I even added in the profile picture of each friend into their v-vcard. Unfortunately facebook doesn't allow you to get phone number info through the web API, which is strange because you can just simulate a login and swipe it by screen scraping, but that's nasty T&C violating thinking neh?

The flickr API mounting should work, to some extent with any service offering that API. For example, 23hq offers free hosting which might appeal. The extensions in libferris 1.3.5 let you see your contacts in a directory, find images by photo ID, browse your photosets and images not yet in a photoset. If you look in your contacts directory, you'll see their photostream and favs as directories.

Note that the thumbnail image is available from flickr through libferris as 32bit RGBA decoded data, so a libferris client can graphically browse a flickr API photoset just as it can a digital camera mounted with libferris. The thumbail EA is the same. Of course, if you copy an image from flickr:// or 23hq:// libferris grabs the largest (or original) image from the site and supplies it to you. Feel the unlocking of captive data. Oh, and upload works as it did last year...

Finally, the mounting of Google docs and spreadsheets. This also has support for appending to plain text files, so you can redirect stdout to append to a google docs text file just as you can >> /tmp/foo.txt.

Spreadsheet mounting goes right down to the cell. So you can use google as a calculator from the command line if it tickles you...


$ export SPREAD=google://spreadsheets/smalltest1/Sheet1
$ echo 5 | ferris-redirect --ea b $SPREAD/9
$ echo 23 | ferris-redirect --ea c $SPREAD/9
$ echo -n "=sum(B9,C9)" | ferris-redirect --ea d $SPREAD/9
$ fcat -a d $SPREAD/9
28


And there are vimeo, youtube and others still needing mounting... but thats what 1.3.6 exists for right? Feel free to send in patches for your fav service! See plugins/context/facebook et al in the source.

5 comments:

Frederik said...
This comment has been removed by the author.
Frederik said...

Awesome, this is just what I was looking for! I notice you've added facebook photo upload support in version 1.3.8. Could you build a binary of that version for Maemo (Nokia N810) as well? I couldn't find anything beyond 1.3.6 in your repository.

monkeyiq said...

Yep, 1.3.6 is the current version, I'll fire up the scratchbox VM when I get a chance and update, though that might be later in December :(

Frederik said...

Are the build instructions available somewhere? I would like to use this setup in a few days, and will only have GPRS internet access at that time. Although previous attempts to install the scratchbox on 64bit AMD didn't go anywhere, I'm up for trying it once more ;)

monkeyiq said...

Building libferris is, I've been told, rather difficult todo. For maemo I just use the normal debian directory and the predictable: dpkg-buildpackage -rfakeroot

I can send you a tarball of the debian directory if you're up for it. Though it takes quite a while to build in sbox and normally some minor tweaks are needed to package new binaries etc. My email address should be fairly easy to guess.