
Google Analytics on Twitter
I started following @googleanalytics today and noticed their bio: “Tech support in 140 characters or less doesn’t work…”.
This makes sense, but to prove them wrong, here are some canned answers they can use for free:
- Press F5 to refresh.
- Restart your computer.
- Upgrade your browser from Internet Explorer 6!
- It works in Chrome.
- Do not copy and paste someone else’s analytics code on to your site.
Sorry for not updating sooner. I’ve been very busy at my day job and afterwards with work on the next Project Peru site. My mind has been a-buzz all week!
So no, I didn’t win jack from the MoonFruit contest. Didn’t even get a “wow, this guy’s site idea sucks balls!” (or something along those lines) tweet from @moontweet.
Only one of my friends tweeted about it and left a comment on the site (thanks @DonnaVitan!) even after I e-mailed a bunch of people that I figured would totally help me out. Am I bit tweaked about that? Ya of course. Don’t want to make a sob story of a blog posty, but WTF?
What the hell happened here? Why was this such an epic fail in networking? This is something that will haunt for quite a while I think.
I know the people I e-mailed when to the site, and some people from Twitter went to the link I tweeted about (who knows if @moontweet was one of them). In 6 days, the site received 136 unique visitors, with 900 page views. That’s about the only thing that I found remotely successful about this little endeavour.
Sorry MoonFruit, I will work on my lame YouTube video acting and solarizing Photoshop filters for the next contest :Pem
Oh and the icing on the cake was that they ended up giving out morn 3 iPods after the creative contest was finished!

Loading ...
1.1 Update
Added a line of code to fix inline links to Twitter profile pages. Links will now be external to http://twitter.com. I discovered this flaw when I checked out my Google Webmaster report!
Birdnapper now has a home of it’s on on codeblink.com here: http://www.codeblink.com/codeblink-open-source-projects/birdnapper-the-php-twitter-feed-widget/
Description:
Bridnapper 1.1 allows you to display the latest tweets of a user of your choosing. The user you choose must have their Tweets public, otherwise Birdnapper will not be able to display properly.
I developed this originally for use on my WordPress blog on www.codeblink.com sidebar, but I’m sure you will be able to find many other applications for it.
Source Files: Download 1.1 ZIP | Download 1.1 RAR
Installation:
1.) Copy and paste the following into a new file called birdnapper.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| function birdnapping ($strUsername,$intShowTweets) {
$html_url="http://twitter.com/$strUsername";
$handle = @fopen($html_url, "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096 );
$content=$content.$buffer;
}
fclose($handle);
}
$content=trim($content);
$start=strpos($content,"<div class=\"section\">");
$end=strpos($content,"<div id=\"pagination\">");
$tweets=substr($content,$start,$end-$start);
$arrayTweets=explode("<li",$tweets);
$tweets="";
$i=1;
while ($i<=$intShowTweets) {
$start=strpos($arrayTweets[$i],">")+1;
$strippedTweet=substr($arrayTweets[$i],$start,strlen($arrayTweets[$i])-$start);
$tweets.="<li>".$strippedTweet;
$i++;
}
// fix links to Twitter profiles. Twitter gives inline links
$tweets=str_replace("href=\"/","href=\"http://twitter.com/",$tweets);
return "<div id=\"birdnapping\">\n<ol>\n$tweets\n</ol>\n<div class=\"follow\"><a href=\"http://twitter.com/$strUsername\" target=\"_blank\">Follow $strUsername »</a></div>\n</div>";
} |
3.) Create a folder called ‘birdnapper’ in your WP folder: /wp-content/plugins/ and save your birdnapper.php file there.
4.) Then copy and paste this code to display the Twitter Feed:
1 2 3 4 5 6 7 8 9
| <ul>
<li>
<div class="sidebarbox">
<h2 class="widgettitle">Twitter Feed</h2>
<?php include($_SERVER['DOCUMENT_ROOT']."/wp-content/plugins/birdnapper/birdnapper.php"); ?>
<?php echo birdnapping("TwitterUserName",5); ?>
</div>
</li>
</ul> |
5.) Make sure to replace ‘TwitterUserName’ with the user name of the person you wish to display Tweets from.
6.) The Birdnapper Twitter feed can be styled anyway you wish with CSS. This is the major advantage it has over an RSS feed. Here is the CSS I currently use:
1 2
| #birdnapping span.entry-meta{ display:block; font-style:italic; font-size:smaller; }
#birdnapping .follow { font-weight:bold; } |
In Development for Version 1.1:
- Option to allow Birdnapper to scrape from a Twitter User or search.twitter.com using a search term.
- Custom Filtering
- Swearing
- Exclude specific Twitter authors
1.1 Update
Added a line of code to fix inline links to Twitter profile pages. Links will now be external to http://twitter.com. Discovered this flaw when I checked out my Google Webmaster report!

Loading ...
Please leave a comment or suggestion below!
Widgets are fun. Why not something for Twitter? It’s probably been done before (didn’t even bother searching for anything before deciding to make this) but I thought it would be fun to just make something on my own.
When it’s done I’ll be posting a link for you all to download and try out.