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.