Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anybody know where to get list of working long2short service websites? The bigger the better - I need at least 100 of them.

share|improve this question
    
Why do you need more than one? – Lèse majesté Jan 20 '11 at 1:08

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 mean it is still working as a url shortening service):

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.

share|improve this answer

Not all URL shortener services are reliable. Check this comparison of popular URL shortener services for their pros & cons. (Here's a shorter comparison by notlong.)

Google also has their own Goo.gl shortener service with an API. Pingdom found Goo.gl to be the fastest.

share|improve this answer

A quick Google search found this. Took about 10 seconds to find.

share|improve this answer
    
most of them is not working - it's 2 yo list – webisdead Jan 18 '11 at 17:23
1  
Did you Google this? There are plenty of lists out there. – John Conde Jan 18 '11 at 18:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.