Monday, November 23, 2009

tiny Thom.as: God Bless Us Every One!


Well, it's not really like in Charles Dickens' A Christmas Carol, and Tiny Tim is certainly different from tinyThom.As, but I just like the name so much, I couldn't resist.

tinyThom.as is a new feature from Library of Congress. If, like me, you have ever tried to create a link to Thomas, their wonderful database of Congressional bills and public laws, you have been frustrated to discover that Thomas cannot create a permanent link. It's a relational database and your link is only temporary to the document. You can only give your reader a link to the database and a search to perform to retrieve the same document. tinyThom.as fixes that. (though why they didn't just create a permalink feature, I don't know). Here is the explanation given:
tinyThom.as is an online tool for preserving the webpages served up by http://thomas.loc.gov for documents related to the U.S. Congress. tinyThom.as generates full-size permanent URLs for THOMAS pages, and also generates short URLs which redirect to those long URLs in order to make them easy to pass around via Twitter, Email, Facebook, etc. We've also provided a public API so that you can generate tinyThom.as URLs in your web applications.

Why is tinyThom.as necessary?

Try this link: http://thomas.loc.gov/cgi-bin/bdquery/D?d111:2:./temp/~bd5CYL::|/bss/|. It worked if you visited THOMAS on November 7, 2009, but it won't work for you now. THOMAS serves most of its results using these links which shut off over time, and only presents permanent links for few of the many kinds of content it serves.

How does tinyThom.as work?

When you send tinyThom.as a URL, it quickly loads the page from the Library of Congress (before the link expires) and then examines the content of the page to determine what search criteria it can use to bring you back to that same page. For example, for a Bill Summary and Status page (example), it finds the bill number and the congressional session, and then generates a URL which searches for just that information. At the same time, it makes a tinyThom.as URL, like http://tinythom.as/0fjZ which you can use to pass the link around without dealing with the long THOMAS URLs.

What kinds of content does tinyThom.as understand?

Bill Summary and Status, like this page.

Bill Text, like this page.

Nominations, like this page.

Congressional Record pages, like this page. (We hope to extend the code to allow it to bring you directly to the remarks in the record, rather than just the list of all remarks on a given page of the Record.)

Some Committee Reports, like this page. Some committee reports are formatted differently, and those don't work yet.

Congressional Record Daily Digests, like this page.

In the future we hope to also process additional content from Thomas; please drop a line at with your requests or if you find a link that doesn't work right.

Integration with OpenCongress and GovTrack

OpenCongress.org and GovTrack.us provide ways for users to discuss legislation, look up bill text and status, learn more about their members of Congress, etc. tinyThom.as makes it easy to find the pages on these sites which correspond to bills in Thomas:

* Put "/oc" at the end of a tinyThom.as URL, like this: http://tinythom.as/8p9O/oc and tinyThom.as will direct that link to the page on OpenCongress, if it exists.
* Put "/gt" at the end of a tinyThom.as URL, like this: http://tinythom.as/8p9O/gt and tinyThom.as will direct that link to the page on GovTrack, if it exists.

In both cases, if the bill doesn't have a good page on the other site (or it's a tinyThom.as link pointing at something other than a bill), it'll just take you straight to Thomas.

About the code

tinyThom.as was written mostly by Asa Hopkins, an open source developer and political activist, with help from others (thanks to the open source code). It is heavily based on the open source code written by Robby Russell for http://rubyurl.com, and the code for tinyThom.as is also open source and available on Github.

Thanks to Chris Griffin for providing the design of RubyURL that tinyThom.as is based on.

Thanks to the folks on the Sunlight Labs wiki for the idea to build this application.
Decorated with an illustration of Tiny Tim and Bob Cratchit from Charles Dickens' A Christmas Carol found on http://blog.pennlive.com/thrive/2007/12/a_dickens_christmas_toast.html

1 comment:

  1. Just a quick clarifying note from one of the creators of tinyThom.as: the site is not an official product of the LIbrary of Congress. tinyThom.as just grabs the expiring URL before it's gone, then makes the equivalent permanent link.

    Asa

    ReplyDelete