RSS

Neil Crookes

Learnings and Teachings on Web Application Development & CakePHP

Jun

22

CakePHP Bit.ly Plugin

A CakePHP plugin for interacting with the Bit.ly API. Provides a simple, familiar API for things like listing a user’s links, fetching click stats for one of your links and creating a bit.ly (or j.mp) link.

Share and Enjoy:

  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Slashdot

This is the second of 5 CakePHP plugins I’m releasing that I mentioned in my ReST DataSource plugin for CakePHP post. They all follow the same approach of including CakePHP models that provide simple and familiar methods for accessing their respective APIs.

You can get the plugin from my github account. I’ll not include much information here, the code is fully commented and there’s a readme file on the github repo page that explains installation, usage and the results you get back. If you’ve any questions or find any issues, please post in the comments below, on the github issue tracker or even better, fork, fix and send me a pull request.

This plugin uses the latest bit.ly API, version 3, which was released a couple of months ago. It implements the methods to get the number of clicks on a link, and to create a new link on the bit.ly or j.mp domains. Version 3 of the Bit.ly API offers fewer features than the previous version weirdly, and they weren’t exactly full featured. For example, they don’t offer an API call to list all the links a user has created. My boss suggested a neat workaround for this however; Bit.ly do expose an RSS feed of a user’s most recent 20 links, so this is used to achieve the fetching a list of links functionality. Hopefully, Bit.ly will expand their API to provide this kind of information in the future.

I’ve used this plugin in a recent work project that aggregates statistical data for a brand from various APIs such as Radian6, Twitter and Bit.ly and visualises the data in a dashboard enabling brands to get a instant grasp of how they are performing against a wide variety of metrics in the social space. The number of clicks on the bit.ly links they create and publish through their various channels is indicative of their brand’s reach.

That’s all for now, stay tuned for the next 3 plugins for Twitter, Facebook and GData. Please let me know what you think in the comments or on twitter.

Share and Enjoy:

  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Slashdot
(5 votes, average: 5.00 out of 5)
Loading ... Loading ...

3 Responses so far

Awesome work Neil! Also on the Twitter plugin you created!

Are you planning to publish a Facebook plugin as well?

Hey Marco… Nick Baker has a great Facebook plugin: https://github.com/webtechnick/CakePHP-Facebook-Plugin

Even did a http://tv.cakephp.org video showing how to use it.

[...] CakePHP Bit.ly Plugin [...]

Leave a comment