Today I'm happy to announce that SweetTweets (both the stand-alone cfc, and the Mango plugin) have been updated and are available for download.
Huge, huge, huge hat tip to Ray Camden, who brought this proejct to my attention. After deconstructing how it worked, I was able to rip out the old search method that SweetTweets did and replace it with the same technology. If you're curious about the tech, I'll get into it a little bit after the download links.
For now, the short version of the story is that link reverse lookups are finally possible -- which means that ANY url shortening service* can be used, and you'll still get your tweetbacks... Yes, even bit.ly!
SweetTweetsCFC users can download version 2.0 from the Riaforge project page. Mango Blog plugin users can get the latest version here:
- Plugin:
- SweetTweets
- Version:
- 2.0
- Requires:
- Mango Blog 1.2+
- Auto-install URL:
- http://fusiongrokker.com/get/SweetTweets
How does it work?
There's a service available called Topsy that has their own API, including reverse-lookup for links -- essentially exactly what I was looking for in my last post about Tweetbacks. And since we don't have to lookup and cache what the short url's are, you should notice that SweetTweets is much faster than previous versions. The only thing I rewrote was the search tech. Local caching and AJAX access are more or less untouched.
If you were using custom code to implement SweetTweetsCFC, you'll notice that the getTweetbacksHTML and init methods have two new optional arguments allowing you to specify the header text for when there are or are-not tweetbacks found. I'm pretty sure that's about the only interface change. The data returned should be roughly the same. Oh, and I updated the links that it adds to hashtags to use search.twitter.com instead of hashtags.org, which is the new standard; and I also fixed a bug where only the first hashtag in the tweet would be converted to a link.
Using Topsy does have its own limitations. They limit results to 50 tweets per page, and I don't see the need to implement paging, so at the moment the most you can get back is the 50 most recent tweets.
*I'm not sure if shorteners that add a "bar" (frame?) to the page will work. This includes services like ow.ly (the shortener used in HootSuite).
Posted in
Mango |
My projects
| 2 Responses
February 11 2010
A little bit less than a year ago I created an open source CFC and companion Mango Blog plugin called SweetTweets that would search for shortened links to your blog entries on Twitter and display any tweets found in a manner similar to TrackBacks. (Note that this wasn't my idea, Dan Zarella invented and pioneered it, I just made a ColdFusion version.) At the time, I was really excited about the project and it seemed to be fairly popular; it even got included in the BlogCFC core, which made my week.
Unfortunately, I'm at a bit of a crossroads. I personally view TweetBacks as nearly dead, if not completely dead. Functionally, they still work the same as they did when I originally released SweetTweets in January of 2009. What's changed is market share. In May, Twitter switched their integrated URL shortening service from TinyURL to Bitly, and within days Bitly's market share overtook TinyURL. You can get the latest statistics at Tweetmeme but the rankings from the last 24 hours have Bitly in 1st place with over 57% of shortened urls, and TinyURL in a distant 2nd place with a mere 6.85%.
Why Bit.ly is bad for TweetBacks
The biggest problem is that Bitly doesn't repeat a short URL. If I shorten the URL http://www.google.com with Bitly, I get http://bit.ly/14d7yE. I bet that if you do the same thing, you won't get the same short URL. This behavior is bad for tweetbacks because we rely on being able to predict the shortened url and search for it. If everyone gets a different short url, then we can't predict what it will be, and thus we can't search for it. Your tweetback is out there, we just can't find it.
This isn't to say that Bitly is evil or anything. I'm sure they have their reasons -- chief among them is probably being able to track click statistics, and if everyone gets the same short url then there's no easy way to tell whose post of that url was the source of the click. That alone could give Twitter something to monetize, so while I'm not particularly fond of the move from TinyURL to Bitly, I understand it.
Where do we go from here?
One option is to just kill SweetTweets. That probably won't happen. Instead, I will probably release an update that pares down the list of supported url shorteners to just TinyURL and Is.Gd. That means that a majority of potential tweetbacks will still be un-searchable, and therefore NOT found and NOT listed on your blog. Unfortunately, we can't just support every URL shortener under the sun (that keeps 1 unique short url per long url), because the twitter search API has a length limit; so we can only support the top N. Right now that's TinyURL and maybe 1 or 2 others.
I wish it didn't have to come to this, but it has. I thought about asking if anyone is aware of a way to reverse-lookup shortened bitly urls, but even if we could, in a practical sense we would run out of room in just a few links. I'm a little sad, but I guess this is the best we can do with what we've got.
Posted in
My projects |
Mango |
Twitter
| 4 Responses
January 04 2010
Mango Blog 1.3 added the auto-installer, and I immediately stole Seb Duggan's style for displaying the download & install link:

Originally I used the RIAForge download URL for my plugins here, but I've since switched to a custom URL on this domain that redirects to the RIAForge download URL. I did this because the RIAForge URL is too long and was forced to wrap in the box, and I just didn't like the way that looked. I thought some people may be interested in how I got this working, so here you go.
I started by creating an array of structures that define my available plugins and their download links:
if (not structKeyExists(application, "_pluginForwardBot") or structKeyExists(url,"reinit")){
application._pluginForwardBot = [
{name="BurntMango",url="http://burntmango.riaforge.org/index.cfm?event=action.download"},
{name="Lightbox2",url="http://mangolightbox.riaforge.org/index.cfm?event=action.download"},
{name="LogViewer",url="http://mangologviewer.riaforge.org/index.cfm?event=action.download"},
{name="PopularPosts",url="http://mangopopular.riaforge.org/index.cfm?event=action.download"},
{name="RelatedEntries",url="http://mangorelated.riaforge.org/index.cfm?event=action.download"},
{name="SmartType",url="http://mangosmarttype.riaforge.org/index.cfm?event=action.download"},
{name="SweetTweets",url="http://sweettweets.riaforge.org/index.cfm?event=action.download"}
];
}
Next, I want to be able to go to this url: http://fusiongrokker.com/get/index.cfm?plugin=[PluginName] and be forwarded to the RIAForge download page:
This works just swell. Notice that I'm adding "&doit=true" to the URL, which you normally won't see when downloading from RIAForge. This extra URL parameter tells RIAForge to skip the page that says "Your download will begin momentarily" and just return the file.
The problem with this, however, is that RIAForge won't count the download in your stats. To get around that, I've added a background thread that will view the download page so that the download count is updated:
I've learned that you always have to assume that some users will be evil, so we also have to make sure we validate the URL parameter:
And the final product of the code looks like this:
//initialize data
if (not structKeyExists(application, "_pluginForwardBot") or structKeyExists(url,"reinit")){
application._pluginForwardBot = [
{name="BurntMango",url="http://burntmango.riaforge.org/index.cfm?event=action.download"},
{name="Lightbox2",url="http://mangolightbox.riaforge.org/index.cfm?event=action.download"},
{name="LogViewer",url="http://mangologviewer.riaforge.org/index.cfm?event=action.download"},
{name="PopularPosts",url="http://mangopopular.riaforge.org/index.cfm?event=action.download"},
{name="RelatedEntries",url="http://mangorelated.riaforge.org/index.cfm?event=action.download"},
{name="SmartType",url="http://mangosmarttype.riaforge.org/index.cfm?event=action.download"},
{name="SweetTweets",url="http://sweettweets.riaforge.org/index.cfm?event=action.download"}
];
}
Then, a quick URL Rewriting rule to get the nice looking URLs:
##### Plugin Forward Bot
RewriteRule ^/get/(.*)$ /_pluginForward/index.cfm?plugin=$1
All in all, not a difficult project.
Posted in
My projects
| No Responses Yet
March 18 2009
Just a super quick update today to let you know that SweetTweetsCFC (and corresponding Mango plugin) are now up to version 1.4.
This update includes some fixes to make everything work on Railo (Thanks to Paul Kukiel for providing me a Railo testing environment -- Owe you a beer!) as well as some additional error trapping surrounding url shortening and JSON parsing so that we're not filling up your error logs if a URL shortening API or the Twitter Search API goes down or changes formats.
Download the latest SweetTweetsCFC from RIAForge
Download the latest SweetTweets Mango Plugin from RIAForge
Posted in
ColdFusion |
Mango |
My projects
| 1 Response
February 04 2009