I’m working on a rails app that searches the Twitter API stream for keywords and then records those tweets.
I’ve used Hpricot before to parse XML but I was wondering if someone could recommend a gem (or even a best practice) to parse JSON from the Twitter search API?
If you use the newly rewritten Twitter gem, you can make a query like this:
The response would be a Hashie::Mash object corresponding to the first status. To access the information, you just call the attribute like it was a method:
The response from this is just text. You don’t have to directly deal with JSON.