File tree Expand file tree Collapse file tree 4 files changed +55
-7
lines changed Expand file tree Collapse file tree 4 files changed +55
-7
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ Requirements:
16
16
Simplejson (not required in python 2.6+)
17
17
18
18
Supported URL shortening services for shrinking long urls:
19
- sandbox (stored locally in memory for testing)
20
- tinyurl.com
21
- tr.im
22
- urlborg.com
19
+
20
+ tinyurl.com burnurl.com
21
+ tr.im hurl.ws
22
+ urlborg.com xr.com
23
23
bit.ly
24
24
is.gd
25
25
cli.gs
@@ -35,12 +35,14 @@ Supported URL shortening services for shrinking long urls:
35
35
to.ly
36
36
budurl.com
37
37
kl.am
38
- xr.com
39
- hurl.ws
40
38
41
39
Shorty can expand any url service by getting the redirect
42
40
location by requesting the tiny url.
43
41
42
+ Shorty also comes with a service called sandbox. This service stores
43
+ the urls in memory and is useful for testing your application
44
+ independently from a remote service.
45
+
44
46
See example.py for a demo of using this library.
45
47
46
48
Build:
Original file line number Diff line number Diff line change 1
1
API available and ready to go!
2
2
++++++++++++++++++++++++++++++
3
- + burnurl.com
4
3
+ u.mavrev.com
5
4
+ snipr.com/snipurl.com/sn.im
6
5
+ adjix.com
Original file line number Diff line number Diff line change
1
+ ## Shorty
2
+ ## Copyright 2009 Joshua Roesslein
3
+ ## See LICENSE
4
+
5
+ ## @url burnurl.com
6
+ class Burnurl (Service ):
7
+
8
+ def _test (self ):
9
+ # all we can test is shrink
10
+ turl = self .shrink ('http://test.com' )
11
+ if turl .startswith ('http://burnurl.com' ):
12
+ return True
13
+ else :
14
+ return False
15
+
16
+ def shrink (self , bigurl ):
17
+ resp = request ('http://burnurl.com/' , {'url' : bigurl , 'output' : 'plain' })
18
+ return resp .read ()
19
+
20
+ def expand (self , tinyurl ):
21
+ # burnurl uses iframes for displaying original url
22
+ # so we cannot expand them using the 301 redirect :(
23
+ return None
24
+
Original file line number Diff line number Diff line change @@ -347,6 +347,28 @@ def expand(self, tinyurl):
347
347
348
348
fongs = Fongs ()
349
349
350
+ # burnurl
351
+ class Burnurl (Service ):
352
+
353
+ def _test (self ):
354
+ # all we can test is shrink
355
+ turl = self .shrink ('http://test.com' )
356
+ if turl .startswith ('http://burnurl.com' ):
357
+ return True
358
+ else :
359
+ return False
360
+
361
+ def shrink (self , bigurl ):
362
+ resp = request ('http://burnurl.com/' , {'url' : bigurl , 'output' : 'plain' })
363
+ return resp .read ()
364
+
365
+ def expand (self , tinyurl ):
366
+ # burnurl uses iframes for displaying original url
367
+ # so we cannot expand them using the 301 redirect :(
368
+ return None
369
+
370
+ burnurl = Burnurl ()
371
+
350
372
# tweetburner
351
373
class Tweetburner (Service ):
352
374
@@ -736,6 +758,7 @@ def expand(self, tinyurl):
736
758
'xr.com' : xr ,
737
759
'short.ie' : shortie ,
738
760
'sandbox.com' : sandbox ,
761
+ 'burnurl.com' : burnurl ,
739
762
'a.gd' : agd ,
740
763
'hurl.ws' : hurlws ,
741
764
'digg.com' : digg ,
You can’t perform that action at this time.
0 commit comments