Skip to content

Commit 30dbbf6

Browse files
committed
Implemented hurl.ws service.
1 parent a7e598a commit 30dbbf6

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Supported URL shortening services for shrinking long urls:
3636
budurl.com
3737
kl.am
3838
xr.com
39+
hurl.ws
3940

4041
Shorty can expand any url service by getting the redirect
4142
location by requesting the tiny url.

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ API available and ready to go!
88
+ idek.net
99
+ easyuri.com
1010
+ rubyurl.com
11-
+ hurl.ws
1211
+ nn.nf
1312
+ piurl.com
1413
+ icanhaz.com

services/hurlws.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Shorty
2+
## Copyright 2009 Joshua Roesslein
3+
## See LICENSE
4+
5+
## @url hurl.ws
6+
class Hurlws(Service):
7+
8+
def __init__(self, username=None):
9+
self.username = username
10+
11+
def shrink(self, bigurl):
12+
parameters = {'url': bigurl}
13+
if self.username:
14+
parameters['user'] = self.username
15+
resp = request('http://www.hurl.ws/api/', post_data=urlencode(parameters))
16+
return resp.read()
17+

shorty.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,21 @@ def expand(self, tinyurl):
286286

287287
cligs = Cligs()
288288

289+
# hurlws
290+
class Hurlws(Service):
291+
292+
def __init__(self, username=None):
293+
self.username = username
294+
295+
def shrink(self, bigurl):
296+
parameters = {'url': bigurl}
297+
if self.username:
298+
parameters['user'] = self.username
299+
resp = request('http://www.hurl.ws/api/', post_data=urlencode(parameters))
300+
return resp.read()
301+
302+
hurlws = Hurlws()
303+
289304
# toly
290305
class Toly(Service):
291306

@@ -716,20 +731,21 @@ def expand(self, tinyurl):
716731
'twurl.nl': tweetburner,
717732
'buk.me': bukme,
718733
'fon.gs': fongs,
719-
'to.ly': toly,
734+
'ub0.cc': urlborg,
720735
'fwd4.me': fwd4me,
721736
'xr.com': xr,
722737
'short.ie': shortie,
723738
'sandbox.com': sandbox,
724739
'a.gd': agd,
740+
'hurl.ws': hurlws,
725741
'digg.com': digg,
726742
'kl.am': klam,
727-
'tweetburner.com': tweetburner,
743+
'to.ly': toly,
728744
'budurl.com': budurl,
729745
'cli.gs': cligs,
730746
'urlborg.com': urlborg,
731747
'is.gd': isgd,
732-
'ub0.cc': urlborg,
748+
'tweetburner.com': tweetburner,
733749
'x.bb': xr,
734750
'tinyurl.com': tinyurl,
735751
}

0 commit comments

Comments
 (0)