Tips And Resources For Software Consultants

TweetPress coming soon to a Twitter Client Near You

TweetPress is the WordPress plugin that gives you total control and ownership of the photos you post to Twitter, sending your traffic back to your own blog, instead of a third party site

I just finished development of this WordPress plugin and Andrew Stone of Twittelator has integrated it into his latest version of Twittelator Pro. As of this post, that version is still in review, so you will have to wait until it is approved to make use of TweetPress.

I have some other very big plans for future releases of TweetPress and if you have any feature requests, feel free to drop me a line. I will do a post as soon as the latest version of Twittelator is approved and demo how it integrates with TweetPress.

iPhone In Action Book


A couple months ago, I was asked by someone on Twitter if they could “introduce me to someone”. I found this question a little odd so I responded with “like a girl or a developer?”. I often tweet about my wife, so I was hoping he was not referring to a girl. He replied with “no, someone at Manning Publishing, they are looking for an author for their book iPhone In Action”. So, I was put in contact with Manning and they eventually offered me the position as one of the authors on the book iPhone In Action.

iPhone In Action is a book (that is already out) and details how to program for the webkit as well as the native iPhone OS. I will be removing the webkit chapters, updating some of the dated chapters, and writing about 6 new chapters related to OS 3.0.

I will be posting about the book and my progress along the way (don’t worry I won’t stop my random tutorials about Twitter, WordPress, etc…). Just wanted to share that and say go out and buy the book (in December when I am finished and will get the commission :) ).

Happy Coding!

Displaying Your FeedBurner Subscriber Count Anywhere – PHP Coding Tutorial


If you are a serious blogger (and I’m sure you are), you probably track your RSS subscribers with FeedBurner. If you don’t, you should be. One thing that has always bugged me about FeedBurner is if you ever wanted to display the number of subscribers on your blog, you were stuck using their image. The image looks like this:

I’m sure you have seen this logo everywhere. Well, not too many people know it, but FeedBurner actually has a very simple API that allows you to just get the subscriber count so you can display it however you would like.

So rather than being limited to this boring icon, you can display your live subscriber count anywhere on your blog. If you are feeling adventurous, you could even super impose it on to your own custom image using the GD library (tutorial to come if sufficient interest, post in the comments if you would like to see it).

Let’s get started…

1. Activate the Awareness API Inside Of Feedburner

Log in to FeedBurner. Click the Publicize tab and the click Awareness API. Finally, click Activate. The service is now enabled.


2. Write The PHP Code To Interface With FeedBurner

There is a lot of data that you could potentially get from FeedBurner, but the code below will just show you how to get your subscriber count.

All you need to do is make a simple GET request using CURL to the URL . Of course replacing brandontreb with your feed’s name.

<code class=’php’><?php

$url    = "";
$ch     = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch); 
if ($data) {
    echo $data;
    preg_match(‘/circulation=\"([0-9]+)\"/’,$data, $matches);
    if ($matches[1] != 0) {
        $subscriberCount = $matches[1];

echo "Join the other $subscriberCount people and subscriber to my RSS feed."


This code is pretty straight forward with a little trickiness to parse the XML. We first make a CURL connection to the URL. Just replace brandontreb with the title of your RSS feed inside of FeedBurner.

Next we print the data. Note: You won’t see the data in your browser unless you do a view source. Since it is XML, your browser will treat it like HTML and not display it. So, we do a preg_match for the element circulation and get it’s value. (Pretty sick right?). The value of our subscriber count will be at index 1 of the matches array.

Then, we just print the subscriber count and voila!

Now, you are no longer a slave to that generic FeedBurner subscriber count icon. Be sure to check out their API for other cool things that you can do with their web services. If you have any questions, feel free to leave them in the comments section of this post. Happy Coding!

Easily Create And Manage SQLite Databases With A Firefox Plugin

If you are doing any Mac, iPhone, HTML5, etc… developement, you have probably had the need for an sqlite database. So, you fire up your Terminal and start manully typing commands to do CREATEs and INSERTs.

You soon realize that this sucks and wish you had something like (shudders) PHPMyAdmin to manage your database. Well, now you do and it’s actually a lot less hiddeous than PHPMyAdmin.

Using the SQLite Manager plugin for Firefox, you can quickly CREATE, MODIFY, and DELETE sqlite databases visually. It’s very simple to use and makes the task of database creation a lot less painful.


Here the description from the plugin site.

Manage any SQLite database on your computer. An intuitive heirarchical tree showing database objects. Helpful dialogs to manage tables, indexes, views and triggers. You can browse and search the tables, as well as add, edit, delete and duplicate the records. Facility to execute any sql query. The views can be searched too. A dropdown menu helps with the sql syntax thus making writing sql easier. Easy access to common operations through menu, toolbars, buttons and context-menu. Export tables/views/database in csv/xml/sql format. Import from csv/xml/sql (both UTF-8 and UTF-16). Possible to execute multiple sql statements in Execute tab. You can save the queries. Support for ADS on Windows.

You can download the SQLite Manager plugin for Firefox here.

XCode Shortcut Cheat Sheet

Xcode ShortcutsThrough my travels through the internets, I have stumbled upon this amazing reference. It’s a complete set of XCode shortcut commands. Learning some of these commands has drastically improved my efficiency when developing in XCode.

As a big fan of not using the mouse (yes I’m and Emacs guy), this is invaluable. Download the full size image here. Enjoy!

Creating A Twitter Client In Objective-C Client Part 2

Creating A Twitter Client For OSX – Part 1

This is part 2 in our series about creating a Twitter client in Objective-C. In case you missed it, here is a link to part 1 of this series.

In the last tutorial I showed you how to retrieve data from Twitter and display the XML in the Console. Today, we will be focusing on sending messages to Twitter via POST. We will be implementing the code to update our Twitter status. So let’s just dig right in.

1. Updating The TwitterRequest Header File

Open up TwitterRequest.h and add the following code (Click the image to enlarge)


We have added two properties. The first isPost will be true when we are calling a method that requires a POST to Twitter. This will be methods such as update_status, follow, etc… Next, the variable requestBody will hold the POST arguments that will be sent to Twitter. These will be things such as status text or friend id.

Finally, we will be adding a method called statuses_update. The reason I named it this is because that is what the method is called in the Twitter API. Like our friends_timeline method, it takes a delegate and selector to call when the request is complete.

Important: I didn’t highlight this in the screenshot but make sure you change theRequest from an NSURLRequest to NSMutableURLRequest. It will give us some additional methods to set up the POST.

2. Updating The Twitter Request Class

Open up **TwitterRequest.m **and add the following code (Click the image to enlarge):


I’ll start by explaining the status_update method. We first set the global isPost property to true. This will tell the request method to make a POST. The next 2 lines set the callback stuff as we did before. The only new line here is setting the requestBody variable. This is just a string that looks like “status=new twitter status”.

The addition to the request **method is what will allow us to POST to Twitter. First, we check if the **isPost property is set. This will be true if request is called from our status_update **method. Next, we call the **setHTTPMethod of the request to POST. This is pretty obvious.

The following line let’s Twitter know the type of data that we are sending to it. Next, we call setHTTPBody to set the body of the request. At some point we will want to URL Encode this string, but that will be for a different tutorial. Just don’t use any special characters such as & and = in your update to Twitter right now. All that is happening on this line is we convert the string to NSData using the **dataUsingEncoding **method of NSString and set it to the HTTPBody.

The last line just sets the Content-Length property to the length of our string. This is needed to correctly do a POST.

3. Calling The statuses_update Method To Update Your Twitter Status

Open up ApplicationDelegate.m and add the following code (click the image to enlarge):


One thing to notice here is I commented out the line to get the friends timeline. This is because having both requests running at the same time with the same request object could cause conflicts. The best way to approch this to create an entirly new TwitterRequest object. I just wanted to keep it short.

This is pretty straight forward. We call the statuses_update method the same way we called the friends_timeline method except pass in the update text. The information received back from Twitter will look something like this:


It’s basically all of your personal profile information.

That’s it for today. If you have any comments or questions, feel free to leave them in the comments of this post or write me on Twitter. You can also download the source for this version below.

Twitter Mac Client Tutorial 2 – Source

Happy Coding!

Installing And Deploying Rails On A Red Hat Server With Passenger

railsI have long been a fan of Ruby on Rails and even jumper on board very early on. The one thing that has held me back from using it in the majority of my projects is the fact that it’s such a pain to configure with Apache.

I know what you are saying… Just switch to a more Rails friendly server. I like and know Apache. Not to mention I also host PHP apps.

With the (re)release of tagacloud, I have recently fell in love with ruby on rails again. So, I looked for a better solution for installation (last time I installed it was 3 years ago) and I stumbled upon Passenger.

It was super easy to use and had my running on Rails in no time.

Deployment is only a matter of uploading application files. No Ruby (on Rails)-specific server configuration required!

Just to give you some background, here are some details about my server.

OS: Linux

Distribution: Red Hat Enterprise Linux Server release 5.3 Hosted At Server Beach

Control Panel: Plesk 8.6

And here are the steps I took to get Ruby on Rails up and running from scratch

1. Install Ruby

<code class=’bash’>yum install ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs</code>

This will do some magic and install Ruby on your system…

2. Download And Install Ruby Gems

Head on over to and download the latest version of Ruby Gems. Here is an example of getting the latest version as of the posting date of this article.

<code class=’bash’>wget</code>

Untar this file…

<code class=’bash’>tar -xvf rubygems-1.3.5.tgz</code>

Navigate to the extracted directory and run the setup script

<code class=’bash’>ruby setup.rb</code>

3. Install Rails

This will install rails. If it asks you about dependencies, just type “Y”

<code class=’bash’>gem install rails</code>

4. Install The Passenger Gem

Now that rails has been installed, we need to install Passenger. The installation process is stupid simple. Passenger can be installed via a Ruby Gem.

<code class=’bash’>gem install passenger</code>

Now, it will do some stuff and and you some questions. At some point in the process, it will check to see if you have all of the dependencies. You most likely will not. Luckily, the geniuses who created Passenger tell you the commands to install all of the dependencies. So just follow the directions and you should be ok.

5. Set Up Passenger For Apache

<code class=’bash’>passenger-install-apache2-module</code>

It will ask you more questions and install everything needed to run Passenger. Pay attention to the stuff spit out at the end of the process. You will take this and paste it into your httpd.conf file. For example, here is the what mine spit out:

<code class=’bash’>LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4
PassengerRuby /usr/bin/ruby</code>

Your httpd.conf file is probably located at /etc/httpd/conf/httpd.conf

You should now be good to go! Navigate to one of your vhosts folder (ex: tagacloud/httpdocs/) and create (or copy) a rails application.

<code class=’bash’>rails someRailsApp</code>

Then set permissions…

<code class=’bash’>chmod -R 755 someRailsApp</code>

And then a miracle happens… and viola! You (should) have a fully functional up and running. Navigate to to see your app in action.

If you have any comments or questions, feel free to leave them in the comments section of this post. (Re)Launched!


So in 2006, my buddy JJ and I took some inspiration from the Million Dollar Homepage and decided to create a totally inovative Web 2.0 site that works on the same principle. That is when we came up with the idea for

Tagacloud is a simple concept that uses the fact that people are obsessed with stats to make a fun game that will also direct traffic to your site. Here is how it works (from the website)…

The Idea:

TagACloud is a very unique idea for a website, thus it will take a little explaining to understand all the facets. To take full advantage of the site, you must be the owner or have control over your own website. The idea is to create a tag that represents your website. A tag is a descriptive phrase or a creative tagline describing your site. Once you have added your tag, it gets added to the Tag Cloud. This is where all the fun begins.

The Goal:

The goal is simple. Become the biggest freakin’ tag on the TagACloud website. The bigger the tag, the more hits it gets. It is that simple.

How Your Tag Gets Bigger:

Your tag gets bigger every time it levels up! And the only way to get your tag to level up is by accumulating points. Points can be acquired in many different ways, but the two primary ways to acquire points are as follows:

  1. Get Clicked: your tag gets 1 point for every click that your tag receives.
  2. Incoming Hits: your tag gets 2 points for every hit you send to your tag on You can get tag specific code via your “Get Tag Code” page.

How Your Tag Gets Hits

We provide visitors several ways to find your tag:

  1. The Home Page: The home page features 200 random tags in random order.
  2. Popular Tags: If your tag is one of the 200 most popular today, the last 7 days, last month, or of all time; it will be featured in order of popularity on the applicable page.
  3. Keywords: Keywords are essential for any tag that wants to generate hits. Keywords are like user defined categories. We combine all the tags that share common keywords. For example,,, and would all share the keyword, SearchEngine. Each tag can have up to 3 keywords associated with it.
  4. The Randomizer: The title says it all. A user can view a random tag’s website, or view a random keyword.


There are 3 big addictions on the web. Without sharing the top 2, we will let you know #3, is statistics. People love to view the stats on anything and everything. Here at TagACloud, we will make sure not to disappoint. You will be able to view statistics for every little thing, to ensure that you always know the current state of your tag. You will also find the website itself is littered with stats. Just keep your eyes open.

As of late 2007, Tagacloud was booming with over 10,000 users. Then, one day JJ and I decided we would take a weekend and “improve” tagacloud. Now, if any of you are programmers, you know “improving” an app takes much longer than you anticipate.

We set out to do it in a weekend and the ideas started flowing. It was Facebook meets Halo 3 meets Digg meets Hannah Montanna meets Karate Kid 3… And then the weekend ended and Tagacloud would remain a “Coming Soon” page for a year and a half… :(

A couple of weeks ago, JJ and I were sitting around and thought to ourselves “Why did we ever take down the old tagacloud?”. One thing led to another and we decided to completely wipe the database and start tagacloud fresh.

So, go fourth and start leveling your tag.

New Alice In Wonderland Movie Looks Sick

I was a big fan of the game Alice that came out for PC. It def portrayed AIW as a darker sort of movie. It looks like Tim Burton will add a similar twist to the latest Alice In Wonderland Movie. Check out the trailer above. gets a much needed update


So, I started this site called a few months back and left out a very important feature. The ability to edit your applications!?! What this means is, users have been testing their apps and putting in “test data” and when it comes time for release, the can’t modify it.

Another feature missing, was the ability to clean out all of your test scores.

Well, thanks to about 8 minutes of my time, this has been resolved and the feature has been added. I am really excited about iphonelb and have some big things planned for it in the future. Write me on Twitter or on my blog if you have any feature requests for it.

Parks & Recreation is to The Office as American Dad is to Family Guy


After seeing the show Parks and Recreation last night, I have come to the conclusion that the show is doomed to fail. Not only is it not funny, it’s jokes try to mimic the dry awkward humor of The Office. Parks and Recreation Fail!

Increasing Your Blog Traffic Using Twitter Trends


Twitter Trends are a very interesting part of Twitter. They are basically the most typed keywords or hashtags on twitter for a given day. Some examples might be #musicmonday or macHeist. These are fun and all but how can you use them to get traffic to my website/blog…

Well, often times trends refer to words associated with website articles, videos, images, etc… For example, the other day, the word mashable was trending on Twitter. This was because had just put out an article on twitter trends. Since people were talking about and more importantly linking to this article, the word mashtable was trending…Naturally, this article got quite a bit of traffic.

Post a Comment On The Article

So, I commented on the article leaving a link to my blog. That day, I got ~50 extra uniques to my blog! You can do the same by closely following the trends. Make sure you read the article and are not just spamming the comments section. Many articles use blog systems (such as WordPress) that allow you to link to your website/blog in your commentsl. Post a comment that contributes to the discussion and I guaruntee it will generate more traffic to your website/blog. Again, don’t be a spammer, contribute something to the discussion…

Be Prompt (comment early)

The sooner you comment on the article, the more traffic it will generate to your site. In the above example, I was like the 15th or 16th to commenter. Imagine if I had been the first…

Although this method isn’t perfect, it’s a sure fire way to generate some quick traffic for your blog/website. Do this every day, and you could be huge!

I freakin hate this page…


Seems to show up way too much.

Alexa Gets a Much Needed Update


If you have a blog/website then you probably have heard of Alexa. If not, you should search your blog in it to find out some interesting stats. Being a stat junkie, I check services like this frequently.

It appears that Alexa has recently updated their interface from their old jenk web .05 hideousness. While it’s not quite web 2.0, I’d say it has a good start as web 1.6 (maybe 1.7 because of the shine on the logo).

On a side note, icodeblog seems to be huge in Canada 😉

WordPress Plugin To Increase Twitter Popularity


If there are two things I love on the intenets, they are WordPress and Twitter. Recently there have been many plugins developed to integrate the two. Mainly, updating your Twitter from your blog or vice-versa. But the question is, do these benefit one another?

Does your Twitter send traffic to your WordPress blog or your WordPress blog get you more followers? Maybe if you are @kevinrose but in my opinion, not really…

I’m currently developing a plugin that will incredibly benenfit your Twitter following using your WordPress blog. It’s called TwitPop and should be available shortly for download. So be sure to subscribe to the RSS feed and check back soon.

Twouble With Twitter Video

Ok, so I am sure you have seen this video by now, but I just had to post it because it’s flippin hilarious.

This perfectly describes mine (and others) Twitter obsession. Kinda sad actually.

"Twouble with Twitter" sous-titré
Uploaded by LePostfr

Google In Real Life Using Google Classic


Image Source:

I depend on Google way too much for spell checking, simple math, and looking up things I don’t know off the top of my head.

It’s sad because often my first instinct when handwriting something or even looking for a lost object in my house is to “Google it”.

WordPress For iPhone Gets A Much Needed Update

A few days ago, the popular blogging tool WordPress released a much needed update to their iPhone application. The main features included in the update were:

  • Landscape mode for writing posts – This is a huge one. It was a total pain in the butt writing blog posts with the vertical keyboard
  • Page Editing/Creation – Meh… How often do you do this?
  • Comment Moderation – Very excited about this feature. I love being able to check out comments quickly without loading my entire blog.
  • Photo resizing – Very cool option. Makes photo uploads go much quicker.

If you have both an iPhone AND a WordPress blog (your own host or, I would highly suggest downloading the WordPress iPhone app for blogging on the go.

Hopefully, having the landscape keyboard mode will motivate me to blog more often.

Click here to download the WordPress application for the iPhone

Top Dugg Story of Today – I hate Dane Cook

LOL, had a post that made it to the top of DIGG today simply titled “I Hate Dane Cook”. That’s freakin hilarious.

Here’s the link.

Free Leaderboard Solution for iPhone Game Developers

What makes most multiplayer games more exciting that single player games? It’s competition! People love to compete with eachother.

And how can competition be achieved in single player games? Leaderboards.

A leaderboard is basically a table ranking players based on their scores in the game. This allows players to see how they stack up against other players.

The Problem

Many programmers either know how to do web development or system development. They don’t know both and certainly don’t know how to integrate the two. This is why I believe there are not more single player games with leaderboards in the App Store.

The Solution

This is where iPhone Leaderboards comes in. It’s an online hosted leaderboard that is incredibly easy to integrate with any iPhone game. The code to integrate with iPhoneLB is given to you to paste directly into your own. It couldn’t be easier.

Try it out and let me know what you think!

Part 3 of iPhone Game Programming Tutorial Posted On iCodeBlog

It’s been a while, but I finally posted part 3 of the iPhone Game Programming tutorial series on The focus of this tutorial was to create a splash page for your game that fades into your game’s main view.

I chose to create this tutorial after seeing many games that just jump right in to the main game play. A splash page makes the game feel more “professional” as well as gives the developer a chance to brand the app by displaying a company logo or something to that extent.

Hopefully, I will be able to get part 4 up in a timely fashion to teach developers how to incorporate sounds into their games.

So, go ahead and check out part 3 of the iPhone Game Programming Tutorial Series.

New Web Application That Will Be Useful For iPhone Games Developers

So, after downloading many iPhone games and talking with a ton of iphone developers, I have a found a huge need in the community. Over the next week I will be developing a killer web application with a web service API that will be free to iPhone developers to use.

I am not going to give out any details at the moment, but be sure to subscribe to my RSS feed as I will be blogging about it through out next week (Spring Break = Time to develop). It should be completed by late next week.

I guarantee, if you are an iPhone game developer, you will benefit tremendously from what I am about to release.

Excited? So am I…

The Only Twitter API PHP Class You Will Ever Need


Note Twitter has switchted their entire interface to use OAUTH and this class no longer works (I should probably change the title hahaha). I will post an oauth connection tutorial in the near future, so make sure to ****subscribe to my RSS feed** for all of the sweet sweets updates!**


So, I started writing a Twitter API Programming series last week… Here is part 1. I have found that there is not much else to teach when it comes to interfacing with Twitter. Basically, we just need to implement all of the Twitter functions.

I have taken it upon myself to create a fully functional Twitter API PHP class. It has every Twitter function you will ever need (less the direct messages). I have also fully documented it with comments directly from the Twitter API so that the functions are easy to understand. Here is how you would use the class. The first parameter of every function is the return type. For Twitter it can be either xml, json, or rss for some functions.

<code class=’php’>include("Twitter.class.php");
    $twitter = new Twitter();
    $twitter->username = "twitteruser";
    $twitter->password = "twitterpass";
    // Show public timeline
    echo $twitter->public_timeline();
    // Update your status
    echo $twitter->update(‘xml’,’This PHP class is flippin sweet!’);
    // Start following a user
    echo $twitter->create(‘xml’,’brandontreb’);</code>

These are just 3 of the functions implemented in this class. The full function list includes:

  • public_timeline
  • friends_timeline
  • user_timeline
  • update
  • replies
  • friends
  • followers
  • show
  • create
  • destroy
  • exists

All of these functions are fully documented and simple to use. You can also check out Twitter’s API here (but you shouldn’t need to).

So, now you can fully **integrate Twitter into any PHP application you create! **

Download The PHP Twitter Class here Twitter.class.php

Also, make sure you subscribe to my RSS feed. More great programming tutorial to come.

Why Many iPhone Apps Suck

I have been downloading many different iPhone apps lately and have noticed that many of them suck.

When I say they suck, I’m not necesarily referring to the content of the app. What I am talking about is the programming of the app. But Brandon, how do you know the programming sucks. Well, frequent crashing is an obvious indicator. Also, taking too long to do various computations as well as overall awkwardness.

This is because many non-programmers or hobby programmers decide they want to make an iPhone app without first learning the objective-c language. People just use jank copy and pasted code frankensteined from different examples, close their eyes and pray. This is the architecture of many iPhone apps.

So, who’s fault is this? Well, at first I wanted to say Apple for their lack of tutorials/explanations. After thinking about it, I feel it’s simply lazy programmers driven by trying to make money rather than the desire create a solid and useful applications. It’s quite sad actually.

One challenge here is the iPhone is a terrible platform to learn programming with. The forced program design assumes you have a solid understaning of object oriented programming design patterns as well as many other advanced programming topics. Many CS students don’t even get this until their second year in college! So how can a novice programmer jump right in and make an iPhone app? They code a pile of crap.

So what’s the solution to this? Well I’ll tell you. Teaching people objective-c from the ground up (that, and Apple being more selective when approving apps). I intend to write a whole series of beginner objective-c tutorials (using the mac as a platform rather than the iPhone). I’m not sure yet if these will be posted here or on I have yet to decide.

So stay tuned for the first Mac Application Development tutorials.

Buzzword Is Now In The App Store

Well, after anxiously waiting for the past 6 days (feels like forever) I have finally gotten that magical email from Apple stating that my “application is ready for sale”. The application of course referring to a game I created called Buzzword.

Buzzword is essentially a clone of the popular party game CatchPhrase ported on to the iPhone. Click Here for all the details on Buzzword.

I am asking a huge favor to anyone that wants to participate. I will give you a free copy of Buzzword (wow saves you a whole buck) if you would kindly write a review of it on your blog or website. If you are interested, either post a comment in this post, contact me, or hit me up on Twitter.

Click on the image below to download Buzzword now.

Download Buzzword In The App Store