Tuesday, July 24, 2007

Emacspeak WebMarks: Online Bookmarks Using Google

Emacspeak module emacspeak-webmarks adds support for adding, viewing and finding Google Bookmarks. Google Bookmarks allows you to store your bookmarks at Google; this module adds support similar to that provided by Firefox Bookmarklets for Google Bookmarks implemented in JavaScript. Note that this module though relatively small was one of the motivators for the code refactoring described in Web Interaction in Emacspeak.

Usage Tips

  • To use Webmarks, you need to be signed into Google.
  • Signing in to Google is easily done using the Webform provided as xml-forms/glogin.html in the Emacspeak distribution --- invoke it via key C-e?/.
  • In addition, the very first time you use Google Bookmarks, add your first bookmark using form xml-forms/bookmark-add.html. Fill out that form, hit submit, and extract the value the zx parameter returned by the server.
  • Use emacs Custom to save the value of the zx parameter as Emacs option emacspeak-webmarks-key.

Web Interaction In Emacspeak

Users running out of SVN will have noticed that the emacspeak codebase has seen a significant number of updates over the last couple of weeks. During this time, I've refactored the Web interaction code in Emacspeak to meet the following goals:

  • All Emacspeak Web smarts have now been re-factored to be independent of any given Web browser. In practice, this avoids code duplication between W3 and W3M support.
  • The interface to XSLT has been significantly improved.
  • When using W3, Emacspeak automatically builds a cache of CSS classnames and ids occuring on the page. These are then used to provide interactive completion when invoking commands emacspeak-extract-by-id (bound to e i in Web pages) and emacspeak-we-extract-by-class (bound to e c in Web pages).
  • Module emacspeak-we holds all code related to editing Web pages before they are displayed.
  • Module emacspeak-webutils holds all Web utility code.
  • Atom and RSS feeds are now pulled using Emacs-22 built-in library url rather than via libxslt. This has the advantage that the feeds are pulled with any cookies the browser may have set during the session.
  • All url templates, search wizards and related Web utilities should now be capable of working similarly under W3 and W3M.
  • Module emacspeak-moz provides a basic level of integration with Firefox --- see my related blog post on FireBox.
  • Module emacspeak-w3m still needs work to take advantage of all of these changes; I myself do not use W3M much, so those updates will happen as and when W3M users contribute the necessary time and patches.

Emacs-G-Client: Leveraging New Picasa API Features

The Google Picasa team announced a set of useful additions to the Picasa Web API yesterday. I've added support for most of these new features in module gphoto that is part of my Emacs G-Client package.

You can get the latest version of package Emacs-G-Client via SVN. Note that this development version of package Emacs-G-Client also includes a light-weight client for finding and playing YouTube videos.

Thursday, July 19, 2007

Emacspeak And Beautiful Code

In the fall of 2006, I was invited by O'Reilly Media to participate in an innovative book project called Beautiful Code. The project put together a set of chapters that focused on capturing the collected insight from creating real software. A particularly attractive aspect of this book was that it focused on code --- unlike many book projects in the field of software engineering, here the goal was to explicitly focus on real code and how it could be made beautiful.

The final book is now available in print. The chapter on Emacspeak is being published on this Web site under a Creative Common Licence --- this HTML version includes Chapter 31: Emacspeak --- The Complete Audio Desktop and the Afterword section from the book.

Friday, July 06, 2007

Searching The Emacspeak Knowledge Base

Information about Emacspeak and its use is available from a collection of Web sites, and being able to restrict the search to these authoritative sources is a good way of quickly finding the right document, without being distracted by the numerous hits one finds when doing a search across the whole Web. You can now search the Emacspeak Knowledge Base by using search form emacspeak-search.html; access it via Emacspeak command emacspeak-websearch and specify /to bring up the list of available forms. This form is also the default search form on the Emacspeak Web site.

HowTo: Implement Emacspeak Knowledge Base Search

Implementing the above using CSE is trivial --- all I needed to do was:

  1. Checked in an HTML file into the Emacspeak repository at Knowledge Base.
  2. Create a CSE that uses the above document.

Emacs G-Client, Reader, And CSE: Searching Past Articles From Google Reader

So I use module greader (part of package G-Client to read a large number of ATOM and RSS feeds. I have long missed the ability to search for articles I remember having read a few weeks or months ago; though I typically find it with an appropriately phrased Google Search, I've always wanted to have the ability to restrict the search to the feeds I subscribe to --- this makes formulating the query much easier.

The advent of CSEs --- see my earlier blog post entitled On The Fly Custom Search combined with Google Reader's ability to export ones subscription list as an OPML file gives me exactly what I needed.

HowTo: Enable Searching Of Past Articles From Google Reader

  • Since you need to be signed in to access the subscription list, the CSE magic cannot directly retrieve your subscription list at present. as a consequence, you need to retrieve and save your list of feeds to a location that is publicly accessible. Feature Request: Would be nice if Reader did this automatically by talking to CSE on behalf of the signed-in user --- that would obviate the next manual step.
  • Export your subscription list using command greader-opml. You'll need to do an svn update to get the above command; alternatively, sign in to Google and retrieve your subscription list.
  • Finally, customize emacspeak option emacspeak-url-template-reading-list-opml to the location of the saved OPML file.

Now, you can use Emacspeak url template reader subscription search from the Emacspeak Web Command Line to search articles you remember having seen in your Google Reader. This is also an excellent means of finding articles of interest that one might have missed in the past. As an example, I recently became interested in Selenium --- an extremely powerful Web application testing framework. Finding articles from the past that I ought to have read but hadn't was a snap using the feature describe here.

Tuesday, July 03, 2007

Google Books In Emacspeak

To coincide with today's announcement of gull-text access to public domain works from Google Books, I've updated the corresponding emacspeak Web Command-Line wizard. Use C-e u to invoke URL templates and type google books to access it.

Thursday, June 28, 2007

Making Search Fly: On-The-Fly Custom Search Engines

The Custom Search Engine team at Google recently released CSE On The Fly a truly amazing feature. Incidentally Google Custom Search is the same piece of magic that brought us Accessible Search last year.

So in the spirit of continuing to enhance the Web Command Line in Emacspeak for every smart Web tool that becomes available, I've checked in two new url templates that demonstrate how one can leverage this to be smart and selective about what one reads.

Searching Favorite Feeds
So I read a lot of Blogs, my current Blog Reader is Google Reader via --- you guessed it -- Emacs module GReader (part of the Emacs G-Client package). But I often feel the need to search my favorite feeds. URL-template Reader Subscriptions lets you do this; what's more it's not specific to Google Reader. All you need do is to publish an OPML file listing your favorite feeds and customize Emacs variable emacspeak-url-template-reading-list-opml to point to that location.
Official GoogleBlog Search
Google has a large number of Google-specific Blogs --- I usually read them through this aggregated feed: All GoogleBlog Stream Emacspeak wizard Official GoogleBlog Search builds a CSE from this feed to let you search articles from all of Google's blogs.

Eventually, I'll also add a meta search wizard that lets one construct any CSE on the fly --- with Lisp such meta-programming is a snap!

Later yesterday evening, I checked in a third url-template called On The Fly CSE that prompts for a search term and the URL for the feed of feeds that specifies the content to search.

Tuesday, June 26, 2007

Emacs-G-Client: Uploading Photos To PicasaWeb

The SVN version of package Emacs-G-Client at g-client now includes a new module gphoto.el that can create albums and upload photos to Google's PicasaWeb site --- as an example, see my photo gallery. Emacspeak users are likely to find the RSS and ATOM feeds for photo albums more useful in general; package gphoto provides easy access to previewing these feeds as well as viewing/editting the metadata that goes along with the pictures. As an example of such a feed, here is Hubbell Labrador's Graduation album.

Multilingual Dictionary Lookup Via Google

From the every useful Google tool deserves a Web Command -line equivalent ...

I just checked in an Emacspeak url-template for accessing multilingual dictionary lookup via Google. Invoke it like any other url-template using C-e u and type mult tab. Specify the word to look up, and the source-target language pair using two letter codes --- this is analogous to how the Emacspeak Translation Via Google tool works. And remember, if there is something you find yourself doing often on the Web, there is most likely an Emacspeak Web Command Line gadget for it --- well, at least that is true for the things I find myself doing often;-)

Friday, June 22, 2007

FireBox: Put The Fox In The Box

I've finally found the right development environment for myself for writing and debugging Web Applications that use JavaScript to implement client-side interaction. It turns out that it wasn't just me who found the thought of programming inside the Web browser a painful experience --- pleasant though the final end-user interaction that those results deliver might be for the final user. I discovered MozRepl --- a read-eval-print loop for Firefox. MozRepl is a Firefox extension that allows you to open a connection to a running Firefox session and gain access to a JavaScript interpreter context that can access all aspects of the Firefox runtime.

This is quite neat, I can now use the power of Emacs to write and debug end-user JavaScript applications. But wait, there is more. So in general, as someone who doesn't need to suffer from the hit on cycles and memory that running an X environment involves, I usually dont start GDM --- the graphical desktop --- on my Linux box. Believe me, running just at the console, especially with the LCD turned off makes my laptop run a lot longer. So challenge: How do you take the fox's head off Firefox? How do you run a headless Firefox?

Turns out that the original X Windows developers didn't always have access to all the displays that they were developing X applications for --- so they created XVFB --- the X Virtual Frame Buffer server. Like all good things in the Open Source world, XVFB continues to survive --- even though today, X developers hardly if ever resort to XVFB. But in the fine UNIX tradition of Get out of my way or I'll turn you into a shell script XVFB also turns out to be just what I needed in order to run FireFox as a headless application.

So in summary: I'm typing this blog on the shuttle bus riding home, with the monitor turned off, and Firefox running headless as I debug some of the code I've been writing. If you want to put the fox's head in a box yourself, here is a pointer to FireBox -- share and enjoy!

Thursday, June 14, 2007

Emacspeak And Beautiful Code

Beautiful Code is a collection of essays on software design, with all proceeds going to Amnesty International. It includes a chapter on the use of Lisp advice to speech-enable Emacs --- AKA Emacspeak. I'll eventually publish an HTML version of my article on the emacspeak Web site. In the meantime, I highly recommend the complete book --- which if you need an accessible version can probably be obtained from organizations like BookShare.

Wednesday, May 23, 2007

Google Group For Package G-Client

I've created a Google Group for package G-Client here: Emacs-G-Client. If you are using package G-Client you can use this group to discuss your experiences with other users. Note that the codebase for this package is evolving actively under SVN at lisp/g-client .

Saturday, May 19, 2007

An Essay On Eyes-Free Computing

I just posted an essay on eyes-free computing to my MathZomeblog. This essay highlights the relevance of ZomeTool in teaching mathematical concepts to students who are visually impaired. More generally, it describes my experiences as a mathematician who cannot see. I'm posting the abstract here; the complete essay can be found on my Web site.

The experiences described in this essay have influenced the software I have built and use on a daily basis; it should be of interest to:

  • Emacspeak users wishing to understand why things look like the way they do in Emacspeak.
  • Students with visual impairments who are entering the field of mathematics.
  • Teachers working with visually impaired students.
  • And the generally curious mathematician who wishes to view the world from a different perspective.

Abstract

This essay outlines some of my experiences as a mathematician who cannot see. Note that I transitioned to being a Computer Scientist during Graduate School. However I strongly believe in the edict Once a mathematician, always a mathematician! — my training in mathematics continues to influence the way I think.

I've been unable to see since the age of 14, which means that I've studied and practiced mathematics predominantly in an eyes-free environment. This essay is my first conscious attempt at asking the question What is involved in doing mathematics when you cannot see? I hope that some of the experiences outlined here will prove insightful to mathematicians at large. At its heart, mathematics is about understanding the underlying structure inherent in a given area of interest — and where no such structure exists — to define the minimal structure that is needed to make forward progress.

The general perception that mathematics might be hard to do in an eyes-free environment probably traces itself to the common view of mathematics as a field where one performs copious calculations on paper. I'll illustrate some of the habits and abilities one evolves over time to compensate for the lack of ready access to scratch memory provided by pencil and paper when working in an eyes-free environment. In this essay, I hope to demonstrate that mathematics in its essence is something far bigger. By being bigger than calculations on paper, not being able to see rarely if ever proves an obstacle when it comes to doing mathematics; the challenges one needs to overcome are primarily centered around gaining access to mathematical material, and communicating ones insights with fellow mathematicians. Thus, a large portion of this essay focuses on solutions to the challenges inherent in mathematical communication.

Wednesday, May 16, 2007

Updates To G-Client

If you use g-client within Emacspeak to access Google Services, you might want to read G-Client Updates.

Wednesday, May 09, 2007

Web 2.0 And The Emacspeak Audio Webtop

Blogging while at WWW 2007. I attended the W3C AC meeting the first two days of the week. The highlight for me from the AC (Advisory Committee meeting was a panel consisting of TimBL and Tim OReilly at the end of the day yesterday. It was fun to hear Tim OReilly define Web-2.0 --- he is credited with originally coining the term, but in the last year, Web 2.0 has often been lightly equated to dynamic Web applications that use JavaScript to the extent that many assume that anything that doesn't use JavaScript is not Web-2.0!

The gist of Tim O's definition of Web-2.0 was to point out that once the Web had gained sufficient coverage and scale, it became possible to build application services on this Web that drew their value from aggregating the data on the Web; his examples ranged from Google to Amazon. His comments were insightful --- my own view now is that Web-2.0 should have been called Web^2 i.e. this current revolution is about applying the power of the Web to itself.

The other amusing piece while running around at the conference and observing what everyone is working on is to realize that now that Web Gadgets and the like are popular, it's now considered a fine idea to write light-weight site-specific tools. Notice that Emacspeak has had this since the late 90's in the form of first the websearch module, to be later joined by url-templates. I believe these innovations arrived earlier on the Emacspeak Webtop as compared to the rest of the Web for the following reasons:

  • Emacspeak relied on Emacs/W3 for Web functionality,and when that browser stopped being maintained, there was a strong need to develop Web tools in the context of Emacspeak.
  • The visual Web was getting too complex for use via speech output, and given the flexibility of the Emacs environment, and the arrival of XSLT in 1999, things were well set up to build a powerful set of Web access wizards.
  • Task-oriented Web tools in Emacspeak led to the conceptual Web Command Line in Emacspeak at a time when command-line interfaces were considered passe'.

Incidentally when I showed others working in the field of accessibility these Emacspeak tools during their early days, they were promptly dismissed as site-specific hacks that wouldn't scale in the face of generic screenreaders that would handle every web page. With the visual Web getting too busy for everyone mainstream users now have access to productivity solutions such as Apple's Dashboard Widgets, IGoogle modules that can be placed on a Web page or the desktop, and other comparable tools. It will be interesting to see how much longer blind users saddled with commercial screenreaders will have to wait before seeing similar tools emerge in their world --- just remember, when that does arrive, Emacspeak had them in 2000!

Thursday, May 03, 2007

Emacspeak 26.0 --- LeadDog Unleashed!

Emacspeak Inc (NASDOG: ESPK) announces the immediate world-wide availability of Emacspeak-26 --a powerful audio desktop for leveraging today's evolving data and service-oriented semantic Web.

Major Enhancements

  1. Added support for ESpeak -- a freely available TTS engine.
  2. Added support for Ocropus -- a freely available OCR engine.
  3. Updated Websearch tools.
  4. Updated URL templates to enhance the Web Command Line.
  5. Support for Google Services like Blogger via package G-Client.
  6. Updated productivity tools in the wizards package.
  7. Fully tested against the upcoming Emacs22.
  8. Better integration between W3 and W3M.

This release contains many user contributed patches including:

  • ESpeak patches from the Oralux project.
  • W3M patches from RDC.

You can visit Emacspeak at SourceForge. The latest development snapshot of Emacspeak is available via subversion from Google Code Hosting. You can subscribe to the emacspeak mailing list emacspeak@cs.vassar.edu by sending mail to the list request address emacspeak-request@cs.vassar.edu.

Tuesday, March 20, 2007

See You At CSUN 2007

After a gap of 7 years, I will once again attend CSUN in LA this year. This will also be Bubbles' first CSUN --- I attended CSUN 6 years in a row with Aster between 1994 and 1999. Anyway, if you're an Emacspeak user and are coming to CSUN this year, look for me at the Google booth. This is also Google's first year at CSUN; I will be there with other Googlers working on accessibility. I arrive Wed morning and leave early Friday morning --- look forward to seeing you there.

Friday, March 02, 2007

An Emacs Client For Google Services

1 An Emacs Interface To Google Services

Google offers a number of services using a Google account. Many of these services also expose a Web API. this package provides a set of Emacs modules for accessing these services from inside Emacs. These modules are designed with an Emacs-centric, rather than a Web-browser centered view of the world. Where necessary Emacs package browse-url is used to invoke the Web browser of choice.

The current distribution can be downloaded from Google Code Hosting and the source code is available via Subversion. Note that this is still work in progress. I'm releasing it as part of the Emacspeak project since I believe the package already has sufficiently useful functionality for users who spend a large amount of their time inside Emacs. There is no dependency on Emacspeak, and all clients provided here can be used without Emacspeak loaded.

1.1 Installation

These are needed only if installing package g-client stand-alone, i.e. outside of Emacspeak.

  • Unpack the tar archive and place the resulting g-client directory on your emacs load-path.
  • Type make to compile the code.
  • In your .emacs, add (load-library "g") to set it up.

1.2 How It Works

Clients are implemented using Google APIs based on Atom Publishing Protocol APP and Google Data APIs (GData). We use curl to retrieve content via HTTPS and xsltproc to transform the retrieved content to browsable HTML.

Clients sign you in the first time you invoke commands that require authentication. Once signed in, the session cookie is cached for future use. Session cookies presently expire in 30 minutes, and clients check for expired cookies when authentication is needed. If the cookie has expired, clients retrieve a fresh cookie using the authentication credentials provided earlier. Note that authorization tokens etc are specific to a given service.

1.3 Top-level Customizations

All clients in this package use Emacs' customize interface to set user preferences. The most commonly used ones are enumerated below.

  • g-user-email Default email-id to use. Individual clients typically override this via user option <clientname>-user-email.
  • g-html-handler Name of function that handles HTML content.

1.4 Google Blogger gblogger

This client implements posting, editting and deleting of blog entries using the new Blogger API --- it replaces the now obsolete atom-blogger that implemented similar functionality using the old Blogger API. It uses value of customization option g-user-email by default; this can be overridden via option gblogger-user-email. See Blogger GData API for the underlying APIs used. For editing posts, I recommend installing nxml-mode.

  • Browse Command gblogger-blog brings up the list of blogs owned by the currently authenticated user.
  • Posting Command gblogger-new-entry takes a post URL and sets up a special buffer where you can compose your article. the post url is obtained from the feed of blogs above, use the post link for the blog to which you wish to post.
  • Browsing Command gblogger-atom-display displays the atom feed for a specified blog as a browsable HTML page. In addition to reading your blog, this helps you find the edit url for individual posts.
  • Editting Command gblogger-edit-entry takes the edit url of a previously posted entry. It retrieves the entry, and sets up a special composition buffer where you can edit the entry.
  • Submitting The special composition buffer created by commands gblogger-new-entry and gblogger-edit-entry provide a special command gblogger-publish (bound to C-c C-c) that submits the entry to blogger.
  • Deleting Command gblogger-delete-entry deletes an entry specified by its edit url.

1.5 Google Calendar gcal

This client can be used to view, add or delete events from the Google Calendar for the authenticated user. It uses value of customization option g-user-email by default; this can be overridden via option gcal-user-email. Commands that display calendar items optionally accept the feed url of the calendar to view; this can be used to view calendars to which the authenticated user has read access. See GData Calendar API for the underlying APIs used.

  • View Command gcal-calendar-agenda displays the default calendar for the authenticated user. A prefix arg prompts for the calendar to display. This command is best used from inside the Emacs calendar; in this case, it uses the date under point when showing the agenda.
  • Add Command gcal-add-event prompts for event details and adds it to the calendar.
  • Accept Command gcal-accept-event accepts an event. Event is specified using the edit url of the event.
  • Delete Command gcal-delete-event deletes an event. Event is specified using the edit url of the event.

1.6 Google Reader greader

This client allows the authenticated user to read, browse and subscribe/unsubscribe to feeds. It uses value of customization option g-user-email by default; this can be overridden via option g-user-email.

  • Reading Command greader-reading-list displays the reading list (river of news).
  • Browsing Command greader-feed-list displays a browsable Web page with pointers to subscribed feeds.
  • Finding Command greader-find-feeds searches for matching feeds to subscribe.
  • Subscribing Commands greader-subscribe-feed and greader-unsubscribe-feed are used to subscribe and unsubscribe.
  • Labeling Command greader-star and greader-add-label are used to label articles.
  • Reading Starred articles can be read by providing a prefix argument to command greader-reading-list. Thus, C-u M-x greader-reading-list will prompt for the specific set of articles to retrieve.

Author: T.V Raman <raman@cs.cornell.edu>>

Date: 2007/03/02 10:36:07

Monday, February 12, 2007

Emacspeak Downloads On GoogleCode

I've now made all Emacspeak releases available from the download area on Googlecode. Going forward, all Emacspeak releases will be made at the GoogleCode site --- not SourceForge. This is because uploading code to GoogleCode is significantly easier than making releases on SourceForge.

But even more importantly, once uploaded, grabbing a release from GoogleCode is significantly easier than on SourceForge's release mechanisms. You can always find a link to the latest releases from Emacspeak on GoogleCode by starting from the Emacspeak GoogleCode page. Follow the link labeled Featured Downloads to download the newest release. I've also made all past releases from the download area --- follow the link labeled downloads on the Emacspeak GoogleCode page.

Here is a brief summary of why I chose to start making releases on GoogleCode, it can be viewed as a short summary of the positives in making the switch.

  • GoogleCode makes it possible to create download URLs that can be bookmarked. No more clicking through multiple pages before getting to the file you want, you can simply point wget, curl or your favorite download tool at a meaningful URL. For instance, here is a pointer to Emacspeak 25 release.
  • The above is more than a convenience --- it's in line with good Web architecture. I've been looking for an alternative to SourceForge ever since that site decided to turn meaningful download URLs from the past into obfuscated pointers into their content management system; this left me with a feeling of having created Open Source Software only to have it locked away in someone else's vault with no easy mechanism for end-users to retrieve what had been released as free software.

Share And Enjoy --- and let's hope we never have download sites that say Glad to be of service as they close behind you with a sigh of a job well done.