View Single Post
Old 04-02-2010, 07:39 PM   #1 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default WP Bit.ly Short Link Generation

This is a stupid simple little script I wrote for use on my personal blog. You can download it from the Wordpress.org Extend repository here (grab trunk if you're just looking at it from the code perspective).

Basically all we're doing here is using the Bit.ly API to generate short links for all your WordPress blog posts. The links can be displayed on posts with the use of a PHP function or a WP shortcode; the plugin also conforms to the short link specification and adds HTTP header information as well as rel=shortlink to your HTML header.

It could easily be ported to work on any other CMS or custom built application, and is just one way that you can make use of custom APIs to interact between your own application and another.

It's the 0.1.0 release, so the comments are lacking at best. More than anything this shows how quick and painless writing a plugin for a CMS should be (thanks to WordPress extensive API) and how easy it is to communicate with a well built API such as Bit.lys. Comments on the code are welcome.
delayedinsanity is offline  
Reply With Quote