<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<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>longurlplease &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/longurlplease/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Mon, 08 Sep 2025 08:13:15 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>longurlplease &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Expanding URLs in Dabr / Twitter]]></title>
		<link>https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/</link>
					<comments>https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 11:46:55 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[dabr]]></category>
		<category><![CDATA[longurlplease]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[url]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=461</guid>

					<description><![CDATA[I hate shortened URLs with a passion.  It makes it hard to see what a link is and whether I&#039;ve visited it before.  If they fail - like tr.im threatened to do - you lose your links with no way to see where they once went.  So, hurrah for LongURLPlease - a service which takes those horrid little links and turns them in to full sized URLs.  Here&#039;s the basic code in PHP to use the service.  function l…]]></description>
										<content:encoded><![CDATA[<p>I hate shortened URLs with a passion.&nbsp; It makes it hard to see what a link is and whether I've visited it before.&nbsp; If they fail - <a href="https://web.archive.org/web/20090815224130/http://blog.tr.im:80/post/159369789/tr-im-r-i-p">like tr.im threatened to do</a> - you lose your links with no way to see where they once went.</p>

<p>So, hurrah for <a href="https://web.archive.org/web/20090912162632/http://www.longurlplease.com/">LongURLPlease</a> - a service which takes those horrid little links and turns them in to full sized URLs.</p>

<p>Here's the basic code in PHP to use the service.</p>

<pre>function long_url($shortURL)
{
 //Use the LongURLPlease API
 $url = "http://www.longurlplease.com/api/v1.1?q=" . $shortURL;

 //Set up CURL
 $curl_handle=curl_init();
 curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
 curl_setopt($curl_handle,CURLOPT_URL,$url);

 //Get the JSON response
 $url_json = curl_exec($curl_handle);

 //Close the connection
 curl_close($curl_handle);

 //Decode the JSON
 $url_array = json_decode($url_json,true);

 //Get the Long URL out of the array
 $url_long = $url_array["$shortURL"];

 if ($url_long == null) //The service couldn't find a long URL
 {
 return $shortURL;
 }

 return $url_long;
}
</pre>

<p>So, how should this be displayed to the user in Dabr?</p>

<p>There are three possibilities.</p>

<h2 id="display"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#display">Display</a></h2>

<p><code>&lt;a href="short.url/foo"&gt;VeryVeryLong.Url/Bar&lt;/a&gt;</code></p>

<p>This keeps the redirect, but it displays the full URL for the user.</p>

<h3 id="pros"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#pros">Pros.</a></h3>

<ul>
    <li>Get to see what the content is.</li>
    <li>Allows the short URL service to record hits etc.</li>
</ul>

<h3 id="cons"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#cons">Cons.</a></h3>

<ul>
    <li>Won't highlight if you've already visited it.</li>
    <li>May cause problems if the VeryLong.Url is too long for the screen.</li>
</ul>

<h2 id="all-change"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#all-change">All Change</a></h2>

<p><code>&lt;a href="VeryVeryLong.Url/Bar"&gt;VeryVeryLong.Url/Bar&lt;/a&gt;</code>
This completely replaces the short URL.</p>

<h3 id="pros"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#pros">Pros.</a></h3>

<ul>
    <li>Hurrah! No more silly URLs.</li>
    <li>Will highlight if you've already visited it.</li>
    <li>You can seen what you're about to click on.</li>
</ul>

<h3 id="cons"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#cons">Cons.</a></h3>

<ul>
    <li>Breaks any statistics management the short URL service was performing (is this a con? Surely the receiving website should be recording such details?)</li>
    <li>May cause problems if the VeryLong.Url is too long for the screen.</li>
</ul>

<h2 id="background"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#background">Background</a></h2>

<p><code>&lt;a href="VeryVeryLong.Url/Bar"&gt;short.url/foo&lt;/a&gt;</code></p>

<h3 id="pros"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#pros">Pros.</a></h3>

<ul>
    <li>Will highlight if you've already visited it.</li>
    <li>You can seen what you're about to click on if you hover over the URL.</li>
    <li>Won't cause problems if the URL is too long for the screen.</li>
</ul>

<h3 id="cons"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#cons">Cons.</a></h3>

<ul>
    <li>Breaks any statistics management the short URL service was performing (is this a con? Surely the receiving website should be recording such details?)</li>
    <li>User can't immediately see what they're about to click on.</li>
</ul>

<h2 id="conclusions"><a href="https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/#conclusions">Conclusions</a></h2>

<p>I prefer replacing the URL completely.&nbsp; I see no value in the various short URL services.&nbsp; The stats that they gather don't seem any better that those your webserver can provide.</p>

<p>However, long URLs can be messy - especially on small screened devices.</p>

<p></p><div id="attachment_467" style="width: 490px" class="wp-caption aligncenter"><img aria-describedby="caption-attachment-467" class="size-full wp-image-467" title="Capture12_17_3" src="https://shkspr.mobi/blog/wp-content/uploads/2009/09/Capture12_17_3.jpg" alt="Long URLs on a BlackBerry" width="480" height="320"><p id="caption-attachment-467" class="wp-caption-text">Long URLs on a BlackBerry</p></div><p></p>

<p>So, which do you prefer?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=461&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2009/09/expanding-urls-in-dabr-twitter/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
