<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>YamdaBlam! &#187; API</title>
	<atom:link href="http://www.yamdablam.com/category/technology/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yamdablam.com</link>
	<description>YATB - Yet Another Technology Blog.</description>
	<lastBuildDate>Wed, 06 Jul 2011 09:33:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>URL Shortening on your site</title>
		<link>http://www.yamdablam.com/2010/07/15/url-shortening-on-your-site/</link>
		<comments>http://www.yamdablam.com/2010/07/15/url-shortening-on-your-site/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 12:35:53 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[php class]]></category>
		<category><![CDATA[url shorteners]]></category>

		<guid isPermaLink="false">http://www.yamdablam.com/?p=32</guid>
		<description><![CDATA[This would be very useful for those companies who wish to track their marketing campaigns running on their website/twitter/Facebook accounts.]]></description>
			<content:encoded><![CDATA[<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
										<iframe
											style="height:25px !important; border:none !important; overflow:hidden !important; width:340px !important;" frameborder="0" scrolling="no" allowTransparency="true"
											src="http://www.linksalpha.com/social?link=http%3A%2F%2Fwww.yamdablam.com%2F2010%2F07%2F15%2Furl-shortening-on-your-site%2F&fc=333333&fs=arial&fblname=like">
										</iframe>
										</div><p>A nice feature to have on a site would be that of a <a href="http://en.wikipedia.org/wiki/URL_shortening" target="_blank">URL shortener</a>. I&#8217;ve looked at some of the more <a href="http://selnd.com/bDk694" target="_blank">popular ones</a> and decided to play with the <a href="http://bit.ly/dmzQ59" target="_blank">API</a> of the most popular, <a href="http://bit.ly" target="_blank">http://bit.ly</a>.</p>
<p>I selected bit.ly as it is the most widely used, your account can be integrated with your Twitter client (Twitter for iPhone for example) and most impressively, you can get real time statistics on the shortened URL&#8217;s you create. This would be very useful for those companies who wish to track their marketing campaigns running on their website/twitter/Facebook accounts.</p>
<p>In the spirit of exploration, I&#8217;ve created a simple PHP bit.ly class, called bitlyApi.class.php.</p>
<p>To get up and running with this, I first created a new bit.ly account and copied out the API key they provide. Once you create an account, you will have access to the realtime statistics feature, otherwise you&#8217;ll just get the bog standard URL shortener service.</p>
<p>The <a title="Jump to the API" href="http://bit.ly/9J5fwb" target="_blank">bit.ly API</a> is really straight forward. Have a look at the previous link to see what you can do.</p>
<p>Taking the most obvious function, URL shortening, the class simply takes in a valid URL, puts together the API request and sends it along with my username and API key and in return a <a title="json.org" href="http://www.json.org/" target="_blank">JSON</a> encoded string.</p>
<p><a href="http://lab.yamdablam.com/downloads/bitly_api_example.zip" target="_blank">Download</a> the sample code and have a look <a href="http://lab.yamdablam.com/#bitly" target="_blank">here</a> at the live demo.</p>
<p>Note, that the code supplied is not production ready. I would need to have your usual input validation etc..</p>
<p>Feel free to comment!</p>
<div style="padding-top:5px;padding-right:0px;padding-bottom:5px;padding-left:0px;;">
										<iframe
											style="height:25px !important; border:none !important; overflow:hidden !important; width:340px !important;" frameborder="0" scrolling="no" allowTransparency="true"
											src="http://www.linksalpha.com/social?link=http%3A%2F%2Fwww.yamdablam.com%2F2010%2F07%2F15%2Furl-shortening-on-your-site%2F&fc=333333&fs=arial&fblname=like">
										</iframe>
										</div>]]></content:encoded>
			<wfw:commentRss>http://www.yamdablam.com/2010/07/15/url-shortening-on-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

