Archive for December, 2008

7 Posts I Didn’t Have Time To Write

7 Posts I Didn\'t Have Time To Write

This year I didn’t have time to write the following blog posts. They’re all still in draft and will more than likely stay that way now. So here’s what you won’t be reading from me any time soon.

Does Your Company Inspire Others

I didn’t have time to write a post titled ‘Does Your Company Inspire Others’ where I discuss the traits of an inspirational thought leader and the importance of networking with like minded people.

Five Reasons To Ignore Tenders Forever

I didn’t have time to write a post titled ‘Five Reasons To Ignore Tenders Forever’ where I announce that I am now refusing to take part in public tenders as I feel they’re a race to the bottom, where cost is given precedence over value.

FOWA Dublin 09 – New Venue Please

I didn’t have time to write a post titled ‘FOWA Dublin 09 – New Venue Please’ where I congratulate Ryan Carson and his crew for choosing Dublin as a conference location but request that they change the venue because Liberty Hall is a cesspit that should have been demolished years ago.

How To Prototype A Web Application

I didn’t have time to write a post titled ‘How To Prototype A Web Application’ where I discuss the importance of understanding the end user, proper wireframing, agile programming, and the stress the value of starting with the interface first.

Solving Real Business Problems

I didn’t have time to write a post titled ‘Solving Real Business Problems’ where I encourage developers to use the hundreds of frameworks, web services and existing web apps to help solve their clients problems instead of pitching the expensive bespoke solution.

The Cost of Success In Ireland

I didn’t have time to write a post titled ‘The Cost of Success in Ireland’ where I analyse how others will perceive your success once you’ve achieved it and cynically ask will they admire you or envy you, will they hold you up as a champion or drag you back down.

The Work Life Balance Of A Web Developer

And finally, I didn’t have time to write a post titled ‘The Work Life Balance of a Web Developer’ where I discuss the challenges of working in isolation and the importance of meeting others in your industry on a regular basis.

I didn’t have time to write all these posts, and more. Maybe next year I’ll have time to write more posts and abandon less of them.

How to Use the Twitter Search API

How To Use the Twitter API

I’ve always wanted to play around with the Twitter API. Everyone seems to be doing it these days. All I needed was a reasonable excuse. So, I decided on integrating relevant Twitter posts into

Recently I created a Twitter account for the new URL shortening service. The purpose of which was to post up new release information, engage with the users and essentially put a ‘face’ onto the service. But for this to be really effective I needed followers, and the best way to get those is to start following people yourself.

Maximising RSS

The only problem was, I needed to know who to follow. This is where Twitter Search comes in. I wanted to follow anyone who was currently using the service and Twitter Search allowed me to find them.

Getting Comfy with the Twitter API

So, to make my life easier, instead of trawling through the search results by hand and manually following each user I decided to write a script to automatically follow everyone who posts a tweet that’s got a link in it.

Here’s the code:

// Parse Search Feed
$rss =& new XML_RSS("");

// Loop through all Tweets
foreach ($rss->getItems() as $item)
    // Get username of who posted it
    $user = substr($item['link'], 19 );
    $posi = strpos($user, '/');
    $user = substr($user, 0, $posi);

    // Follow the user via the Twitter API
    $req = new HTTP_Request(''.$user.'.xml');

    $req->setBasicAuth('username', 'password');
    $response = $req->sendRequest();

It's a very basic script right now, but it will form the basis of a more comprehensive solution as it matures. But, for only 10 lines of code, it's pretty powerful!

The script has 4 main parts:

  • Retrieve and parse the RSS feed for the search
  • Loop through the feed
  • Extract the username from the link of each tweet
  • Use the Twitter API to follow the creator of the tweet

Obviously there are some issue with duplicates to be ironed out, and I think I'd like to store some of this information in a database too, but that can all come later. For now, I can say that I've dipped my toe into the world of the Twitter API and so far I like what I've seen.


To use this script, you'll need to install and configure PEAR. I used the XML_RSS and HTTP_Request packages in this example.

Comments Closed