Running my own URL shortener
March 20, 2013 12:46 PM   Subscribe

I'd like to run my own URL shortener. I could roll my own, but my coding skills are ... primitive. Does anyone have a package for this out there that they like? I have mysql on the server I'd like to run it on, and both perl and php. Probably python, too, but I'm python-illiterate (for now - of course, this could be a good project to ramp up on python...) Thanks!
posted by rmd1023 to Computers & Internet (11 answers total) 4 users marked this as a favorite
 
Can I ask why you want to do this? Is it just for practice or some other reason?
posted by PuppetMcSockerson at 12:49 PM on March 20, 2013


Some combination of practice and community service and privacy and the ability to delete things if desired. It's for use in a small online forum where people have complained about potential privacy issues with using tinyurl etc.
posted by rmd1023 at 12:56 PM on March 20, 2013


A search on CPAN turned up this module, which appears to fit your bill nicely.
posted by pont at 1:24 PM on March 20, 2013


Here's the three lines of PHP code necessary to make a page that simply forwards to another URL, btw. The functionality to do an HTTP redirect is also in every web server. So that part of the coding at least is very simple, the rest depends on how sophisticated a user interface you need for creating the URLs and any security needed. (Of particular concern would be things like SQL injection if a database were involved or other code injection attacks.)
posted by XMLicious at 1:27 PM on March 20, 2013


Does your forum not allow for creation of actual links? URL shorteners have no purpose in HTML content.
posted by odinsdream at 1:31 PM on March 20, 2013 [2 favorites]


IMHO the biggest issues with running your own URL shortener are the reliability and longevity of the service. If it's only half a dozen people, maybe it's not such a big deal. But keep in mind that if the database ever goes down (for example), or the domain expires, or whatever, none of those links are going to work for anyone until you fix it. It's totally possible that this is fine with you, but it's something to think about.
posted by primethyme at 1:31 PM on March 20, 2013


Via Lifehacker: Make Your Own URL Shortening Service.
posted by spilon at 1:34 PM on March 20, 2013 [2 favorites]


Thanks for the suggestions so far - I'll check them out.

Does your forum not allow for creation of actual links?
It's not web-based. Less PHPBB and more IRC.

It's totally possible that this is fine with you
Yep! One of the things I'd maybe like to do is to auto-expire everything anyways after a week or a month or something. It's definitely intended for ephemeral content, not archiving.

Of particular concern would be things like SQL injection if a database were involved or other code injection attacks.
Yeah - that's one of the reasons I don't trust my own coding skills for a make-from-scratch solution. I know enough to know I suck.
posted by rmd1023 at 1:43 PM on March 20, 2013


Another thing you need to be careful about is people using your URL shortener to send spam and malware.
posted by Dansaman at 3:50 PM on March 20, 2013


Self-link but perhaps useful to you?
posted by migurski at 12:05 AM on March 21, 2013


Does your forum not allow for creation of actual links? URL shorteners have no purpose in HTML content.

they allow you to present non-meaningful data in the referer logs of link targets.
posted by russm at 5:20 AM on March 21, 2013


« Older Job satisfaction: How important are coworkers?   |   Drums on the cheap Newer »
This thread is closed to new comments.