Episode 8 - Searching Twitter


Click on image above for a preview

Released: Oct 12, 2009, Running time: 83 min

In this episode:

We work through hitting Twitter Search using the search terms we created in episode 6 and episode 7.

Tags: rspec, cucumber, mockups, model, controller, twitter, search

Add to cart$5.00
  • Share

We are finally getting to implementing the core purpose of Brandizzle: searching social networks. Our first target is Twitter because everyone is doing it, but we will also add Google Blog Search as a source in a future episode.

First, we take a look at the mockups again, to get a general overview of our status and where we are heading next.

We have the ability to add search terms and we want to use those search terms to fetch query Twitter for user statuses. We will hold search results in the database because we want to use them later on.

We use jnunemaker’s Twitter gem to access the Twitter API. Before adding the gem to the project however, we want to get a general overview of the available search functionality. For this, we first run a few test searches from a simple Ruby script.

BDD is a design technique more than anything else. As we write the model specs for running the search, we come across a great example on how writing specs first improves the design of your application.

We model the SearchResult as we go along, talking about why it might be best to structure it.

Speccing external services is always a bit challenging, so you can watch as we find the best way to mock the Twitter search response and write specs that are relevant to our functionality.

At the end of the episode, Brandizzle can pull in search results from Twitter.


  • Vlcsnap-2009-10-12-11h28m24s53
  • Vlcsnap-2009-10-12-11h28m46s14
  • Vlcsnap-2009-10-12-11h34m53s74
  • Vlcsnap-2009-10-12-11h35m29s205
  • Vlcsnap-2009-10-12-11h38m52s168
  • Vlcsnap-2009-10-12-11h40m04s112
  • Vlcsnap-2009-10-12-11h40m55s139
  • Vlcsnap-2009-10-12-11h41m42s92
  • Vlcsnap-2009-10-12-11h42m31s73

No comments yet

Commenting is disabled.