File tree Expand file tree Collapse file tree 3 files changed +24
-12
lines changed Expand file tree Collapse file tree 3 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,5 @@ def shrink(self, bigurl):
11
11
12
12
def expand (self , tinyurl ):
13
13
resp = request ('http://long.to/do.txt' , {'url' : tinyurl })
14
- url = resp .read ()
15
- if url .startswith ('http' ):
16
- return url
17
- else :
18
- raise ShortyError (url )
14
+ return resp .read ()
19
15
Original file line number Diff line number Diff line change
1
+ ## Shorty
2
+ ## Copyright 2009 Joshua Roesslein
3
+ ## See LICENSE
4
+
5
+ ## @url to.ly
6
+ class Toly (Service ):
7
+
8
+ def shrink (self , bigurl ):
9
+ resp = request ('http://to.ly/api.php' , {'longurl' : bigurl })
10
+ return resp .read ()
11
+
Original file line number Diff line number Diff line change @@ -286,6 +286,14 @@ def expand(self, tinyurl):
286
286
287
287
cligs = Cligs ()
288
288
289
+ # toly
290
+ class Toly (Service ):
291
+
292
+ def shrink (self , bigurl ):
293
+ resp = request ('http://to.ly/api.php' , {'longurl' : bigurl })
294
+ return resp .read ()
295
+ toly = Toly ()
296
+
289
297
# fongs
290
298
class Fongs (Service ):
291
299
@@ -471,11 +479,7 @@ def shrink(self, bigurl):
471
479
472
480
def expand (self , tinyurl ):
473
481
resp = request ('http://long.to/do.txt' , {'url' : tinyurl })
474
- url = resp .read ()
475
- if url .startswith ('http' ):
476
- return url
477
- else :
478
- raise ShortyError (url )
482
+ return resp .read ()
479
483
480
484
shortto = Shortto ()
481
485
@@ -633,9 +637,9 @@ def expand(self, tinyurl):
633
637
'chilp.it' : chilpit ,
634
638
'digg.com' : digg ,
635
639
'tweetburner.com' : tweetburner ,
636
- 'buk.me' : bukme ,
637
- 'twurl.nl' : tweetburner ,
638
640
'tr.im' : trim ,
641
+ 'twurl.nl' : tweetburner ,
642
+ 'to.ly' : toly ,
639
643
'cli.gs' : cligs ,
640
644
'urlborg.com' : urlborg ,
641
645
'is.gd' : isgd ,
@@ -646,5 +650,6 @@ def expand(self, tinyurl):
646
650
'fwd4.me' : fwd4me ,
647
651
'short.ie' : shortie ,
648
652
'sandbox.com' : sandbox ,
653
+ 'buk.me' : bukme ,
649
654
}
650
655
You can’t perform that action at this time.
0 commit comments