Good afternoon dear developers,
upon gnoming through the OpenGuide to London and inserting pages with horribly long Website Addresses a though came cross my mind. I wrote a CGI that reads an URL from a MYSQL defined by a 5-character code, and sends a Location: Command to the Browser. It will be needed to write some CGIs that make it possible to add a link between the 5-char-code and an url to the database. There are some more possiblities to get rid of long urls. I would be happy if some developer would act upon my request.
This is my CGI:
#!/usr/bin/perl
use DBI;
$DB_DB = "test"; $DB_Host = "localhost"; $DB_User = "root"; $DB_Password = "***";
$dbh = DBI->connect("dbi:mysql:$DB_DB:$DB_Host",$DB_User,$DB_Password);
$sth = $dbh->prepare("select url from test where shortname = '".$ARGV[0]."'"); $sth->execute;
if($sth->rows == 0) { print "Error"; } else { while ($row = $sth->fetchrow_hashref) { print "Location: ",$row->{'url'},"\n\n"; } } $dbh->disconnect; exit 0;
The DB looks temporalily like this
test |--- test |--- ID, shortname, url
Regards
Kai M Poppe
On Sat, Jun 18, 2005 at 05:04:33PM +0200, Kai Michael Poppe wrote:
upon gnoming through the OpenGuide to London and inserting pages with horribly long Website Addresses a though came cross my mind. I wrote a CGI that reads an URL from a MYSQL defined by a 5-character code, and sends a Location: Command to the Browser. It will be needed to write some CGIs that make it possible to add a link between the 5-char-code and an url to the database. There are some more possiblities to get rid of long urls. I would be happy if some developer would act upon my request.
Hi,
If I understand you correctly, your idea is to have a service like tinyurl.com or makeashorterlink.com. What extra benefits would your method have?
Personally I don't see the need to shorten OpenGuides URLs; they are a fairly managable lenth at the moment and, moreover, convey useful information (ie they are a fairly close representation of the page name).
Cheers,
This one time, at band camp, Dominic Hargreaves wrote:
Personally I don't see the need to shorten OpenGuides URLs; they are a fairly managable lenth at the moment and, moreover, convey useful information (ie they are a fairly close representation of the page name).
What's more, Google likes them. The Guardian and other Vignette sites with their crappy 4534,3452342,34254.html type links just don't get treated as well.
e.g.: http://www.google.co.uk/search?hl=en&q=Barton+Swing+Aqueduct&btnG=Go...
----- Original Message ----- From: "Dominic Hargreaves" dom@earth.li
If I understand you correctly, your idea is to have a service like tinyurl.com or makeashorterlink.com.
Thats right
Personally I don't see the need to shorten OpenGuides URLs; they are a fairly managable lenth at the moment and, moreover, convey useful information (ie they are a fairly close representation of the page name).
I dont want to shorten to OG URLs, but those URLs that are put in the Guide as reference to official websites or things like that.
Regards
Kai M Poppe
openguides-dev@lists.openguides.org