Skip to content

Commit 953d689

Browse files
committed
Implemented hex.io service.
1 parent 04ed0a4 commit 953d689

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+
class Hexio(Service):
7+
8+
def shrink(self, bigurl):
9+
resp = request('http://hex.io/api-create.php', {'url': bigurl})
10+
url = resp.read()
11+
if url.startswith('http'):
12+
return url
13+
else:
14+
raise ShortyError('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+
class Hexio(Service):
352+
353+
def shrink(self, bigurl):
354+
resp = request('http://hex.io/api-create.php', {'url': bigurl})
355+
url = resp.read()
356+
if url.startswith('http'):
357+
return url
358+
else:
359+
raise ShortyError('Failed to shrink url')
360+
361+
hexio = Hexio()
362+
350363
# burnurl
351364
class Burnurl(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)