Mobile app version of vmapp.org
Login or Join
Reiling115

: The list at http://hjacob.com/blog/2009/07/url-shortener-redirects/ looks pretty good. There are still a lot of dead links. Here are the listed URLs that responded 200 OK (which doesn't necessarily

@Reiling115

The list at hjacob.com/blog/2009/07/url-shortener-redirects/ looks pretty good. There are still a lot of dead links. Here are the listed URLs that responded 200 OK (which doesn't necessarily mean it is still working as a url shortening service):


03e.de - 03e.de/ 6url - 6url.com/ A.gd - a.gd/ Bit.ly - bit.ly/ Chilp.it - chilp.it/ Cli.gs - cli.gs/ Decent URL - decenturl.com/ Doiop - doiop.com/ Dot.TK - dot.tk/ DwarfURL - www.dwarfurl.com/ Fhurl - fhurl.com/ Good.ly - good.ly/ HotRedirect - www.hotredirect.com/ Idek.net - idek.net/ Jaze Redirect Services - iscool.net/ Kl.am - kl.am/ Korta ner din url - www.x.se/ Krz.ch - krz.ch/ Lil.io - lil.io/ Linkbun.ch - linkbun.ch/ LinksPreadeR (l.pr) - l.pr/ Metamark - metamark.net/ Migre - migre.me/ MooURL - moourl.com/ Nutshellurl - nutshellurl.com/ QR.cx - qr.cx/ Redirx - redirx.com/ SN.im / Snurl.com - sn.im/ Shorl - shorl.com/ Short URL - url.lotpatrol.com/ Short links - shortlinks.co.uk/ ShortURL - www.shorturl.com/ Shorty - get-shorty.com/ Shrinkurl - shrinkurl.us/ SimURL - simurl.com/ Starturl - www.starturl.com/ TightURL - tighturl.com/ TinyURL - tinyurl.com/ Tr.im - tr.im/ Trim.li - trim.li/ Tweetburner.com - twurl.nl/ Twi.bz - twi.bz/ U28.de - u28.de/ URL.co.uk - url.co.uk/ URL.ie - url.ie/ URLBee - urlbee.com/ URLBorg - urlborg.com/ URLShort - urlshort.com/ URLcut - urlcut.com/ UX.lv - ux.lv/ VDirect - www.vdirect.com/ Webalias - www.webalias.com/ Yep.it - yep.it/ Z.pe - z.pe/ aPu.sh - apu.sh/ adjix aka. ad.vu - www.adjix.com arm.in - arm.in/ awe.sm - awe.sm awe.sm - create.awe.sm/ binged.it - binged.it budurl - budurl.com/ daa.li - daa.li/ dot.tk - dot.tk easyURL - easyurl.net/ fb.me - fb.me goo.gl - goo.gl/ goo.la - goo.la/ ho.io - ho.io/ i2h.de - i2h.de/ is.gd - is.gd/ j.mp - j.mp/ myurl - myurl.in/ ne1.net - ne1.net/ notlong - notlong.com/ su.pr - su.pr/ to.vg - to.vg/ turo.us - turo.us/ tweak.tk - tweak.tk twt.tl - twt.tl/ u.nu - u.nu/ unfake.it - unfake.it/ wp.me - wp.me

For some reason, my favorite wasn't listed.

Here's the code:

#!/usr/bin/env python

import socket
import sys
import urlparse
import urllib

from BeautifulSoup import BeautifulSoup

filename = 'url_shortner_redirects.html'
source = 'http://hjacob.com/blog/2009/07/url-shortener-redirects/'
page = urllib.urlopen(source).read()
soup = BeautifulSoup(page)
links = soup.findAll('a')

good_links = []
# Some links hang forever - set a timeout of 5 seconds
socket.setdefaulttimeout(5)
for link in links:
# Look for the links with rel=external
if link.get('rel', '') == 'external' and link.get('title','') != '':
# Only the links with no path are url shortners - the rest are articles
url = urlparse.urlparse(link['href'])
if len(url.path) < 2:
name = link.string.strip()
href = link['href']
try:
x = urllib.urlopen(href)
if x.code in [200]:
print >> sys.stderr, '%s is responding' % href
good_links.append((name, href))
elif x.code in [403, 404, 503]:
print >> sys.stderr, '%s is dead (%d)' % (href, x.code)
else:
print >> sys.stderr, "Unknown code %d in %s" % (x.code, href)
x.close()
except IOError:
print >> sys.stderr, "Connection refused for %s" % href

# Print in stack exchange markdown
unique_links = sorted(list(set(good_links)))
print 'n'.join(['* %s - <%s>' % (name, href) for name, href in unique_links])


I hope that helps.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Reiling115

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme