The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Capitol Words

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Capitol Words Posted: Dec 27, 2008 11:16 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Capitol Words
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Ok, I suppose this means I was bored this morning. I was looking around for some web API's that might be worthwhile doing a "Smalltalk Daily" on, and I ran across "Capitol Words" - and it's a fascinating look at word frequency (out of the Congressional Record, I presume). You can search by date, by Congressman - it's a nifty site.

So of course, I figured some Smalltalk code might be in order. Here's a simple example:


url := 'http://capitolwords.org/api/word/bank/2008/5/23/feed.json'.
contents := (HttpClient new get: url) contents.
data := JsonReader readFrom: contents readStream.
^data

That will give you back a dictionary, assuming you loaded JsonReader from the public store - like this:

You can also do a query for the entire year, using a different url:


url := 'http://capitolwords.org/api/word/bank/2008/feed.json'.

I sorted those results by date, and got this:

It would be straightforward to pop a little GUI on that - I'll leave that as an exercise to the reader :)

Now Listening to: How Can I Refuse by Heart from: Rock The House Live

Read: Capitol Words

Topic: What is the financial mess? Previous Topic   Next Topic Topic: If this means no Manny, it's good news

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use