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

Commit953d689

Browse files
committed
Implemented hex.io service.
1 parent04ed0a4 commit953d689

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

‎README‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Supported URL shortening services for shrinking long urls:
2121
tr.im hurl.ws
2222
urlborg.com xr.com
2323
bit.ly snipurl.com
24-
is.gd
24+
is.gd hex.io
2525
cli.gs
2626
twurl.nl (tweetburner)
2727
digg.com

‎TODO‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ API available and ready to go!
1111
+ icanhaz.com
1212
+ shrinkify.com
1313
+ abbrr.com
14-
+ hex.io
1514
+ go2cut.com
1615
+ shw.me
1716
+ lin.cr

‎services/hexio.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Shorty
2+
## Copyright 2009 Joshua Roesslein
3+
## See LICENSE
4+
5+
## @url hex.io
6+
classHexio(Service):
7+
8+
defshrink(self,bigurl):
9+
resp=request('http://hex.io/api-create.php', {'url':bigurl})
10+
url=resp.read()
11+
ifurl.startswith('http'):
12+
returnurl
13+
else:
14+
raiseShortyError('Failed to shrink url')
15+

‎shorty.py‎

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

348348
fongs=Fongs()
349349

350+
# hexio
351+
classHexio(Service):
352+
353+
defshrink(self,bigurl):
354+
resp=request('http://hex.io/api-create.php', {'url':bigurl})
355+
url=resp.read()
356+
ifurl.startswith('http'):
357+
returnurl
358+
else:
359+
raiseShortyError('Failed to shrink url')
360+
361+
hexio=Hexio()
362+
350363
# burnurl
351364
classBurnurl(Service):
352365

@@ -813,6 +826,7 @@ def expand(self, tinyurl):
813826
'digg.com':digg,
814827
'kl.am':klam,
815828
'to.ly':toly,
829+
'hex.io':hexio,
816830
'budurl.com':budurl,
817831
'cli.gs':cligs,
818832
'urlborg.com':urlborg,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp