Showing posts with label google docs. Show all posts
Showing posts with label google docs. Show all posts

Friday, May 14, 2010

Plasma, libferris, and Google Spreadsheets

In my previous post I talked about how libferris now has a Plasma DataEngine which lets you get at the entire virtual filesystem (on demand) from plasmoids.

I've since extended things so that the DataEngine now includes a Service object, allowing plasmoids to write data too. Instead of tracking an XWindow, this time around I'll track a Google Spreadsheet and update it through the plasmoid. Doing this makes a mounted web service like GSpreads into a pastebin with access control applied. So you can share your clipboard with anyone in your "group" or company and stop others getting at it.

The two plasmoids show two spreadsheet cells, the top one is the top coloured cell and the bottom plasmoid is the lower, purple cell. The purple cell in the spreadsheet is the sum of the three cells in the column around the peachy cell above it.

First, updating the spreadsheet through the browser is reflected in the plasmoid. Towards the end I copy and paste a number into the top plasmoid, which updates the peach cell in the spreadsheet, which in turn causes the purple cell to update and so the lower plasmoid shows this updated sum. Of course, these two plasmoids don't have to be on the same machine. For tracking sums or other formulas, the ferris_graph might be more interesting if you are more interested in the trends than the current value.

plasma-google-spread.avi from Ben Martin on Vimeo.

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.