Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite04588a

Browse files
committed
Implemented burnurl.com service.
1 parent30dbbf6 commite04588a

File tree

4 files changed

+55
-7
lines changed

4 files changed

+55
-7
lines changed

‎README‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Requirements:
1616
Simplejson (not required in python 2.6+)
1717

1818
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
2323
bit.ly
2424
is.gd
2525
cli.gs
@@ -35,12 +35,14 @@ Supported URL shortening services for shrinking long urls:
3535
to.ly
3636
budurl.com
3737
kl.am
38-
xr.com
39-
hurl.ws
4038

4139
Shorty can expand any url service by getting the redirect
4240
location by requesting the tiny url.
4341

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+
4446
See example.py for a demo of using this library.
4547

4648
Build:

‎TODO‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
API available and ready to go!
22
++++++++++++++++++++++++++++++
3-
+ burnurl.com
43
+ u.mavrev.com
54
+ snipr.com/snipurl.com/sn.im
65
+ adjix.com

‎services/burnurl.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Shorty
2+
## Copyright 2009 Joshua Roesslein
3+
## See LICENSE
4+
5+
## @url burnurl.com
6+
classBurnurl(Service):
7+
8+
def_test(self):
9+
# all we can test is shrink
10+
turl=self.shrink('http://test.com')
11+
ifturl.startswith('http://burnurl.com'):
12+
returnTrue
13+
else:
14+
returnFalse
15+
16+
defshrink(self,bigurl):
17+
resp=request('http://burnurl.com/', {'url':bigurl,'output':'plain'})
18+
returnresp.read()
19+
20+
defexpand(self,tinyurl):
21+
# burnurl uses iframes for displaying original url
22+
# so we cannot expand them using the 301 redirect :(
23+
returnNone
24+

‎shorty.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,28 @@ def expand(self, tinyurl):
347347

348348
fongs=Fongs()
349349

350+
# burnurl
351+
classBurnurl(Service):
352+
353+
def_test(self):
354+
# all we can test is shrink
355+
turl=self.shrink('http://test.com')
356+
ifturl.startswith('http://burnurl.com'):
357+
returnTrue
358+
else:
359+
returnFalse
360+
361+
defshrink(self,bigurl):
362+
resp=request('http://burnurl.com/', {'url':bigurl,'output':'plain'})
363+
returnresp.read()
364+
365+
defexpand(self,tinyurl):
366+
# burnurl uses iframes for displaying original url
367+
# so we cannot expand them using the 301 redirect :(
368+
returnNone
369+
370+
burnurl=Burnurl()
371+
350372
# tweetburner
351373
classTweetburner(Service):
352374

@@ -736,6 +758,7 @@ def expand(self, tinyurl):
736758
'xr.com':xr,
737759
'short.ie':shortie,
738760
'sandbox.com':sandbox,
761+
'burnurl.com':burnurl,
739762
'a.gd':agd,
740763
'hurl.ws':hurlws,
741764
'digg.com':digg,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp