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.