<?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"
	>

<channel>
	<title> &#187; shorten url | TechStartups.com Keyword Feed</title>
	<atom:link href="http://www.techstartups.com/tag/shorten-url/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techstartups.com/tag/shorten-url/</link>
	<description>This is the keyword feed for  &#187; shorten url from TechStartups.com. We're crazy about this topic and want to share our passion for all things related. Visit us at http://www.techstartups.com</description>
	<pubDate>Fri, 03 Sep 2010 05:15:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
			<item>
		<title>Flickr Desktop Uploadr for Photos</title>
		<link>http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/</link>
		<comments>http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 16:11:14 +0000</pubDate>
		<dc:creator>Kristopher Smith</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Product Review]]></category>
		<category><![CDATA[flickr desktop uploadr]]></category>
		<category><![CDATA[flickr ftp upload]]></category>
		<category><![CDATA[flickr uploadr]]></category>
		<category><![CDATA[magic api]]></category>
		<category><![CDATA[photo uploader]]></category>
		<category><![CDATA[road runner]]></category>
		<category><![CDATA[road runner cable internet]]></category>
		<category><![CDATA[road runner upload speed]]></category>
		<category><![CDATA[shorten url]]></category>

		<guid isPermaLink="false">http://www.techstartups.com/?p=3631</guid>
                
		<description><![CDATA[<p><em>By Senior Editor – Kris Smith (<a href="http://twitter.com/croncast" target="_blank">@croncast</a>)</em></p>
<p><a rel="attachment wp-att-3634" href="http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/picture-57/"><img class="alignleft size-full wp-image-3634" style="margin-left: 10px; margin-right: 10px;" title="Picture 57" src="http://www.techstartups.com/blog/wp-content/uploads/2009/11/Picture-57.png" alt="Picture 57" width="186" height="44" /></a>If you&#8217;re a Flickr user and not a <a title="Flickr Desktop Uploadr" href="http://www.flickr.com/tools/" target="_blank"><span class="zem_slink">Flickr</span> Desktop Uploadr</a> user, you should be. It is the hidden gem of the heavily trafficked site and best friend of frequent uploaders.</p>
<p>The <a title="Flickr Desktop Uploadr" href="http://www.flickr.com/tools/" target="_blank"><span class="zem_slink">Flickr</span> Uploadr</a> for desktop use have gone through changes over the years. It&#8217;s reached its current maturity at 3.2.1 after being plagued with upload crashes, double uploads and copy loss for images. This version doesn&#8217;t suffer likes its predecessors . . . well, not as much.</p>
<p>There still are occasional crashes but the Uploadr handles restarting better and will load up the last batch of photos for upload with their copy intact on restart. I&#8217;ve found this to be a more frequent issue if I am trying to upload photos to <a class="zem_slink" title="Flickr" rel="wikipedia" href="http://en.wikipedia.org/wiki/Flickr">Flickr</a> from a throttled internet connection with slow speeds. Cough, Time-Warner <a class="zem_slink" title="Road Runner High Speed Online" rel="wikipedia" href="http://en.wikipedia.org/wiki/Road_Runner_High_Speed_Online">Road Runner</a>, cough.</p>
<p><span id="more-3631"></span></p>
<p>With that said, I&#8217;ve found the Uploadr the easiest way to get batch photos online with titles, descriptions, tags and grouped the way the I want them with privacy settings. Here&#8217;s a peek for the uninitiated:</p>
<p style="text-align: center;"><a rel="attachment wp-att-3633" href="http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/picture-55/"><img class="size-full wp-image-3633 aligncenter" title="Picture 55" src="http://www.techstartups.com/blog/wp-content/uploads/2009/11/Picture-55.png" alt="Picture 55" width="617" height="470" /></a></p>
<p>With the ability to create groups like this and see them in left hand column I am able to more effectivley tell a story about each image as it relates to one another. To be honest, it is kind of fun to be able to create a <a class="zem_slink" title="Narrative" rel="wikipedia" href="http://en.wikipedia.org/wiki/Narrative">narrative</a> about a photo set that can be shared with viewers.</p>
<p>You&#8217;ll also notice in the &#8216;Description&#8217; box that the copy begins with two characters &#8216;*^&#8217;. Well, as an added bonus of using the Flickr Uploadr to get photos on Flickr, I also use it as a front-end to insert photos on my own blog and to also send links to them on Twitter.</p>
<p>With the use of the magic <span class="zem_slink">API</span>, RSS, I have two separate crontab scripts running that read my personal Flickr <a class="zem_slink" title="RSS" rel="wikipedia" href="http://en.wikipedia.org/wiki/RSS">RSS feed</a> and look for these two characters. The * tells the script to take the title and description and add them as posts to my <span class="zem_slink">personal blog</span>. The ^ tells the script to grab the title and URL of the image on Flickr (shorten it), then send it on to Twitter in my personal Twitter account. The special characters are a control mechanism that allow me to filter or choose additional syndication for my photos.</p>
<p>I&#8217;m going down a geeky path here and will pull back a bit. The Flickr Desktop Uploadr isnt&#8217; something that is brand new or undergone a massive revision lately. What it is to me an many others is a powerful tool built as an add-on to a service to make it more valuable.</p>
<p>DISCLOSURE OF MATERIAL CONNECTION: <a href="http://cmp.ly/0">http://cmp.ly/0</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/8a256c5e-0ff2-4f36-b4f0-77da21e35b52/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=8a256c5e-0ff2-4f36-b4f0-77da21e35b52" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a href="http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/">Flickr Desktop Uploadr for Photos</a> is a post from: <a href="http://www.techstartups.com">TechStartups.com</a></p>
<br /><br /><br /><br /><br /><br /><br /><br />Tags: <a style="display:inline" href="http://www.techstartups.com/tag/flickr-desktop-uploadr/" rel="tag">flickr desktop uploadr</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/flickr-desktop-uploadr/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/flickr-ftp-upload/" rel="tag">flickr ftp upload</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/flickr-ftp-upload/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/flickr-uploadr/" rel="tag">flickr uploadr</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/flickr-uploadr/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/magic-api/" rel="tag">magic api</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/magic-api/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/photo-uploader/" rel="tag">photo uploader</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/photo-uploader/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/road-runner/" rel="tag">road runner</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/road-runner/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/road-runner-cable-internet/" rel="tag">road runner cable internet</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/road-runner-cable-internet/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/road-runner-upload-speed/" rel="tag">road runner upload speed</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/road-runner-upload-speed/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/shorten-url/" rel="tag">shorten url</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/shorten-url/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a><br /><br />]]></description>
			<content:encoded><![CDATA[<p><em>By Senior Editor – Kris Smith (<a href="http://twitter.com/croncast" target="_blank">@croncast</a>)</em></p>
<p><a rel="attachment wp-att-3634" href="http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/picture-57/"><img class="alignleft size-full wp-image-3634" style="margin-left: 10px; margin-right: 10px;" title="Picture 57" src="http://www.techstartups.com/blog/wp-content/uploads/2009/11/Picture-57.png" alt="Picture 57" width="186" height="44" /></a>If you&#8217;re a Flickr user and not a <a title="Flickr Desktop Uploadr" href="http://www.flickr.com/tools/" target="_blank"><span class="zem_slink">Flickr</span> Desktop Uploadr</a> user, you should be. It is the hidden gem of the heavily trafficked site and best friend of frequent uploaders.</p>
<p>The <a title="Flickr Desktop Uploadr" href="http://www.flickr.com/tools/" target="_blank"><span class="zem_slink">Flickr</span> Uploadr</a> for desktop use have gone through changes over the years. It&#8217;s reached its current maturity at 3.2.1 after being plagued with upload crashes, double uploads and copy loss for images. This version doesn&#8217;t suffer likes its predecessors . . . well, not as much.</p>
<p>There still are occasional crashes but the Uploadr handles restarting better and will load up the last batch of photos for upload with their copy intact on restart. I&#8217;ve found this to be a more frequent issue if I am trying to upload photos to <a class="zem_slink" title="Flickr" rel="wikipedia" href="http://en.wikipedia.org/wiki/Flickr">Flickr</a> from a throttled internet connection with slow speeds. Cough, Time-Warner <a class="zem_slink" title="Road Runner High Speed Online" rel="wikipedia" href="http://en.wikipedia.org/wiki/Road_Runner_High_Speed_Online">Road Runner</a>, cough.</p>
<p><span id="more-3631"></span></p>
<p>With that said, I&#8217;ve found the Uploadr the easiest way to get batch photos online with titles, descriptions, tags and grouped the way the I want them with privacy settings. Here&#8217;s a peek for the uninitiated:</p>
<p style="text-align: center;"><a rel="attachment wp-att-3633" href="http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/picture-55/"><img class="size-full wp-image-3633 aligncenter" title="Picture 55" src="http://www.techstartups.com/blog/wp-content/uploads/2009/11/Picture-55.png" alt="Picture 55" width="617" height="470" /></a></p>
<p>With the ability to create groups like this and see them in left hand column I am able to more effectivley tell a story about each image as it relates to one another. To be honest, it is kind of fun to be able to create a <a class="zem_slink" title="Narrative" rel="wikipedia" href="http://en.wikipedia.org/wiki/Narrative">narrative</a> about a photo set that can be shared with viewers.</p>
<p>You&#8217;ll also notice in the &#8216;Description&#8217; box that the copy begins with two characters &#8216;*^&#8217;. Well, as an added bonus of using the Flickr Uploadr to get photos on Flickr, I also use it as a front-end to insert photos on my own blog and to also send links to them on Twitter.</p>
<p>With the use of the magic <span class="zem_slink">API</span>, RSS, I have two separate crontab scripts running that read my personal Flickr <a class="zem_slink" title="RSS" rel="wikipedia" href="http://en.wikipedia.org/wiki/RSS">RSS feed</a> and look for these two characters. The * tells the script to take the title and description and add them as posts to my <span class="zem_slink">personal blog</span>. The ^ tells the script to grab the title and URL of the image on Flickr (shorten it), then send it on to Twitter in my personal Twitter account. The special characters are a control mechanism that allow me to filter or choose additional syndication for my photos.</p>
<p>I&#8217;m going down a geeky path here and will pull back a bit. The Flickr Desktop Uploadr isnt&#8217; something that is brand new or undergone a massive revision lately. What it is to me an many others is a powerful tool built as an add-on to a service to make it more valuable.</p>
<p>DISCLOSURE OF MATERIAL CONNECTION: <a href="http://cmp.ly/0">http://cmp.ly/0</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/8a256c5e-0ff2-4f36-b4f0-77da21e35b52/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=8a256c5e-0ff2-4f36-b4f0-77da21e35b52" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a href="http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/">Flickr Desktop Uploadr for Photos</a> is a post from: <a href="http://www.techstartups.com">TechStartups.com</a></p>
<br /><br /><br /><br /><br /><br /><br /><br />Tags: <a style="display:inline" href="http://www.techstartups.com/tag/flickr-desktop-uploadr/" rel="tag">flickr desktop uploadr</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/flickr-desktop-uploadr/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/flickr-ftp-upload/" rel="tag">flickr ftp upload</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/flickr-ftp-upload/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/flickr-uploadr/" rel="tag">flickr uploadr</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/flickr-uploadr/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/magic-api/" rel="tag">magic api</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/magic-api/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/photo-uploader/" rel="tag">photo uploader</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/photo-uploader/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/road-runner/" rel="tag">road runner</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/road-runner/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/road-runner-cable-internet/" rel="tag">road runner cable internet</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/road-runner-cable-internet/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/road-runner-upload-speed/" rel="tag">road runner upload speed</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/road-runner-upload-speed/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/shorten-url/" rel="tag">shorten url</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/shorten-url/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a><br /><br />]]></content:encoded>
			<wfw:commentRss>http://www.techstartups.com/2009/11/16/flickr-desktop-uploadr-for-photos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Shorten and Track Your Own URL&#8217;s</title>
		<link>http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/</link>
		<comments>http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 20:00:03 +0000</pubDate>
		<dc:creator>Kristopher Smith</dc:creator>
				<category><![CDATA[Startup Ideas]]></category>
		<category><![CDATA[Startup Tips]]></category>
		<category><![CDATA[shorten url]]></category>
		<category><![CDATA[startup shortener]]></category>
		<category><![CDATA[url metrics]]></category>
		<category><![CDATA[url shortener]]></category>
		<category><![CDATA[url shortening bookmarklet]]></category>

		<guid isPermaLink="false">http://www.techstartups.com/?p=2169</guid>
                
		<description><![CDATA[<p><em>By Senior Editor – Kris Smith</em></p>
<p><a rel="attachment wp-att-2170" href="http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/shorty_2/"><img class="alignleft size-medium wp-image-2170" style="margin-left: 10px; margin-right: 10px;" title="shorty_2" src="http://www.techstartups.com/blog/wp-content/uploads/2009/10/shorty_2-225x300.jpg" alt="shorty_2" width="225" height="300" /></a>Startups, it&#8217;s time to begin shortening and tracking your own URL&#8217;s. Taking control of your data is the simplest way of measuring your engagement online next to direct conversations with users. Look at it like taking a survey without asking a single question.</p>
<p><strong>So what?</strong></p>
<p>There is a wealth of data to be collected from that shortened URL that can help you make your product(s) better. Take for instance if your job is to write blog posts and then tweet about them. If you&#8217;re tracking the data yourself you can measure the most active click-through times and tweet then. Another example might be your desire to track other click-throughs and track the geo-location of your biggest fans.</p>
<p>Other great information to get from this one-click survey is what site did they use to click-through, also known in the biz as referrer and what some might call the holy grail of necessary data for digital product development, user-agent. For when you need to know the application or platform, such as mobile, to better your products. So that&#8217;s so what.</p>
<p><strong>So how?</strong></p>
<p>There are a couple of ways to get it done. If you want the data and tracking that I described above without having to parse your log files you can use the code samples that I will add below. If you simply are looking for a way to brand your URL shortener and use it on Twitter, then you can follow the discussion and directions in this forum thread for using .htacess on Apache [http://www.webmasterworld.com/forum92/2545.htm].</p>
<p>For those of you ready to get it on with a kick start and build on top of it, here we go. I should mention that this is for those on a LAMP box. Not sure what LAMP means? This isn&#8217;t for you then. If you do and are on another platform, feel free to follow along for the concepts.</p>
<p><strong>First &#8211; Get a short URL</strong></p>
<p>The best choice doing this the right way is to figure out something that comes close to your regular URL. Say your site is goldfishbowlpirate.com and you found that gbp.me was available. Then you would snatch it up and your short URL&#8217;s would look like http://gbp.me/1234. Make sure you host the account on a <a class="zem_slink" title="LAMP (software bundle)" rel="wikipedia" href="http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29">LAMP server</a>.</p>
<p><strong>Second &#8211; Edit the .htaccess file</strong></p>
<p>Simple copy and past job into your .htaccess file will get you on the road to tracking your click-throughs like a champ.</p>
<p>code: RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^[0-9] /</p>
<p><strong>Third &#8211; MySQL table</strong></p>
<p>You&#8217;ll need to setup a couple of tables: one to store the URL&#8217;s that need to be redirected and one to store the click-through data.</p>
<p><strong>The base table</strong></p>
<pre><code>CREATE TABLE IF NOT EXISTS `url_base` (
`url_id` int(11) NOT NULL auto_increment,
`url_key` varchar(6) NOT NULL default '',
`url_value` varchar(255) NOT NULL default '',
`bookmarklet` tinyint(1) NOT NULL default '0',
`user_host` varchar(255) NOT NULL default '',
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY  (`url_id`),
KEY `url_key` (`url_key`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;</code></pre>
<p><strong>The clicks table</strong></p>
<pre><code>CREATE TABLE IF NOT EXISTS `url_clicks` (
`hit_id` int(11) NOT NULL auto_increment,
`url_id` int(11) NOT NULL default '0',
`hit_host` varchar(255) NOT NULL default '',
`hit_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
`hit_referer` varchar(255) NOT NULL default '',
`hit_agent` varchar(255) NOT NULL default '',
PRIMARY KEY  (`hit_id`),
KEY `hit_agent` (`hit_agent`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;</code></pre>
<p><strong>Fourth &#8211; Code it up</strong></p>
<p>This is where the magic truly happens. We need code to create shortened URL&#8217;s, handle the redirects by looking up the shortened URL in the url_base table and track the click-through in the url_clicks table.</p>
<p>I&#8217;ve created a zip file that has all the necessary files in it and the SQL above for <a href="http://croncast.com/techstartups_shortener.zip" target="_blank">download</a>. Also Included in the zip are the .htaccess file and four PHP scripts.</p>
<ol>
<li>config.php &#8211; A configuration file</li>
<li>index.php &#8211; To act as the index incase there is an error with the redirect</li>
<li>makeit.php &#8211; To make shortened URL&#8217;s. It can be called by other programs like an API</li>
<li>makeit_b.php &#8211; To make shortened URL&#8217;s for a Bookmarklet for easy testing and copy and paste. To use the Bookmarklet simply right-click on your bookmarks toolbar and paste the code below into the &#8216;Location&#8217; section. Make sure to swap out &#8216;yourshorturl&#8217; with your own!<code>javascript:(function(){var%20a=window,b=document,c=decodeURIComponent,d=a.open('http://yourshorturl/makeit_b.php?url='+c(b.location),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=145px,width=200px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})(); </code></li>
</ol>
<p>Now that you&#8217;ve got all the code you need to begin shortening and tracking your own URL&#8217;s you can <a href="http://asu.ms/3erqsL" target="_blank">take a look at a sample</a> of a very simple admin page. I&#8217;ve been using this system of shortening for nearly two years for all of my Twitter URL&#8217;s.</p>
<p>A special thanks to <a title="Mike Marusin @marusin" href="http://marusin.com" target="_blank">Mike Marusin</a> for writing the first version of this code for his own personal URL shortener back in 2007.</p>
<p>DISCLOSURE OF MATERIAL CONNECTION: <a href="http://cmp.ly/4">http://cmp.ly/4</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/295ad09b-8bbb-4daf-9176-43147699d1f4/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=295ad09b-8bbb-4daf-9176-43147699d1f4" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a href="http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/">Shorten and Track Your Own URL&#8217;s</a> is a post from: <a href="http://www.techstartups.com">TechStartups.com</a></p>
<br /><br /><br /><br /><br /><br /><br /><br />Tags: <a style="display:inline" href="http://www.techstartups.com/tag/shorten-url/" rel="tag">shorten url</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/shorten-url/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/startup-shortener/" rel="tag">startup shortener</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/startup-shortener/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/url-metrics/" rel="tag">url metrics</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/url-metrics/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/url-shortener/" rel="tag">url shortener</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/url-shortener/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/url-shortening-bookmarklet/" rel="tag">url shortening bookmarklet</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/url-shortening-bookmarklet/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a><br /><br />]]></description>
			<content:encoded><![CDATA[<p><em>By Senior Editor – Kris Smith</em></p>
<p><a rel="attachment wp-att-2170" href="http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/shorty_2/"><img class="alignleft size-medium wp-image-2170" style="margin-left: 10px; margin-right: 10px;" title="shorty_2" src="http://www.techstartups.com/blog/wp-content/uploads/2009/10/shorty_2-225x300.jpg" alt="shorty_2" width="225" height="300" /></a>Startups, it&#8217;s time to begin shortening and tracking your own URL&#8217;s. Taking control of your data is the simplest way of measuring your engagement online next to direct conversations with users. Look at it like taking a survey without asking a single question.</p>
<p><strong>So what?</strong></p>
<p>There is a wealth of data to be collected from that shortened URL that can help you make your product(s) better. Take for instance if your job is to write blog posts and then tweet about them. If you&#8217;re tracking the data yourself you can measure the most active click-through times and tweet then. Another example might be your desire to track other click-throughs and track the geo-location of your biggest fans.</p>
<p>Other great information to get from this one-click survey is what site did they use to click-through, also known in the biz as referrer and what some might call the holy grail of necessary data for digital product development, user-agent. For when you need to know the application or platform, such as mobile, to better your products. So that&#8217;s so what.</p>
<p><strong>So how?</strong></p>
<p>There are a couple of ways to get it done. If you want the data and tracking that I described above without having to parse your log files you can use the code samples that I will add below. If you simply are looking for a way to brand your URL shortener and use it on Twitter, then you can follow the discussion and directions in this forum thread for using .htacess on Apache [http://www.webmasterworld.com/forum92/2545.htm].</p>
<p>For those of you ready to get it on with a kick start and build on top of it, here we go. I should mention that this is for those on a LAMP box. Not sure what LAMP means? This isn&#8217;t for you then. If you do and are on another platform, feel free to follow along for the concepts.</p>
<p><strong>First &#8211; Get a short URL</strong></p>
<p>The best choice doing this the right way is to figure out something that comes close to your regular URL. Say your site is goldfishbowlpirate.com and you found that gbp.me was available. Then you would snatch it up and your short URL&#8217;s would look like http://gbp.me/1234. Make sure you host the account on a <a class="zem_slink" title="LAMP (software bundle)" rel="wikipedia" href="http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29">LAMP server</a>.</p>
<p><strong>Second &#8211; Edit the .htaccess file</strong></p>
<p>Simple copy and past job into your .htaccess file will get you on the road to tracking your click-throughs like a champ.</p>
<p>code: RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^[0-9] /</p>
<p><strong>Third &#8211; MySQL table</strong></p>
<p>You&#8217;ll need to setup a couple of tables: one to store the URL&#8217;s that need to be redirected and one to store the click-through data.</p>
<p><strong>The base table</strong></p>
<pre><code>CREATE TABLE IF NOT EXISTS `url_base` (
`url_id` int(11) NOT NULL auto_increment,
`url_key` varchar(6) NOT NULL default '',
`url_value` varchar(255) NOT NULL default '',
`bookmarklet` tinyint(1) NOT NULL default '0',
`user_host` varchar(255) NOT NULL default '',
`create_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY  (`url_id`),
KEY `url_key` (`url_key`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;</code></pre>
<p><strong>The clicks table</strong></p>
<pre><code>CREATE TABLE IF NOT EXISTS `url_clicks` (
`hit_id` int(11) NOT NULL auto_increment,
`url_id` int(11) NOT NULL default '0',
`hit_host` varchar(255) NOT NULL default '',
`hit_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
`hit_referer` varchar(255) NOT NULL default '',
`hit_agent` varchar(255) NOT NULL default '',
PRIMARY KEY  (`hit_id`),
KEY `hit_agent` (`hit_agent`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;</code></pre>
<p><strong>Fourth &#8211; Code it up</strong></p>
<p>This is where the magic truly happens. We need code to create shortened URL&#8217;s, handle the redirects by looking up the shortened URL in the url_base table and track the click-through in the url_clicks table.</p>
<p>I&#8217;ve created a zip file that has all the necessary files in it and the SQL above for <a href="http://croncast.com/techstartups_shortener.zip" target="_blank">download</a>. Also Included in the zip are the .htaccess file and four PHP scripts.</p>
<ol>
<li>config.php &#8211; A configuration file</li>
<li>index.php &#8211; To act as the index incase there is an error with the redirect</li>
<li>makeit.php &#8211; To make shortened URL&#8217;s. It can be called by other programs like an API</li>
<li>makeit_b.php &#8211; To make shortened URL&#8217;s for a Bookmarklet for easy testing and copy and paste. To use the Bookmarklet simply right-click on your bookmarks toolbar and paste the code below into the &#8216;Location&#8217; section. Make sure to swap out &#8216;yourshorturl&#8217; with your own!<code>javascript:(function(){var%20a=window,b=document,c=decodeURIComponent,d=a.open('http://yourshorturl/makeit_b.php?url='+c(b.location),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=145px,width=200px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})(); </code></li>
</ol>
<p>Now that you&#8217;ve got all the code you need to begin shortening and tracking your own URL&#8217;s you can <a href="http://asu.ms/3erqsL" target="_blank">take a look at a sample</a> of a very simple admin page. I&#8217;ve been using this system of shortening for nearly two years for all of my Twitter URL&#8217;s.</p>
<p>A special thanks to <a title="Mike Marusin @marusin" href="http://marusin.com" target="_blank">Mike Marusin</a> for writing the first version of this code for his own personal URL shortener back in 2007.</p>
<p>DISCLOSURE OF MATERIAL CONNECTION: <a href="http://cmp.ly/4">http://cmp.ly/4</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/295ad09b-8bbb-4daf-9176-43147699d1f4/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=295ad09b-8bbb-4daf-9176-43147699d1f4" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p><a href="http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/">Shorten and Track Your Own URL&#8217;s</a> is a post from: <a href="http://www.techstartups.com">TechStartups.com</a></p>
<br /><br /><br /><br /><br /><br /><br /><br />Tags: <a style="display:inline" href="http://www.techstartups.com/tag/shorten-url/" rel="tag">shorten url</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/shorten-url/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/startup-shortener/" rel="tag">startup shortener</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/startup-shortener/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/url-metrics/" rel="tag">url metrics</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/url-metrics/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/url-shortener/" rel="tag">url shortener</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/url-shortener/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a>, <a style="display:inline" href="http://www.techstartups.com/tag/url-shortening-bookmarklet/" rel="tag">url shortening bookmarklet</a> <a style="text-decoration:none;display:inline" href="http://www.techstartups.com/tag/url-shortening-bookmarklet/feed" rel="tag"><img style="border:none; display:inline" src="/img/tagrss.gif" border="0"></a><br /><br />]]></content:encoded>
			<wfw:commentRss>http://www.techstartups.com/2009/10/20/shorten-and-track-your-own-urls/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
