File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Supported URL shortening services:
15
15
urlborg.com
16
16
bit.ly
17
17
is.gd (shrink only)
18
+ cli.gs
18
19
19
20
Language: Python
20
21
Website: http://gitorious.org/shorty
Original file line number Diff line number Diff line change @@ -268,14 +268,40 @@ def shrink(self, bigurl):
268
268
269
269
isgd = Isgd ()
270
270
271
+ # cli.gs
272
+ class Cligs (Service ):
273
+
274
+ def __init__ (self , apikey = None , appid = None ):
275
+ self .apikey = apikey
276
+ self .appid = appid
277
+
278
+ def shrink (self , bigurl , title = None ):
279
+ parameters = {'url' : bigurl }
280
+ if title :
281
+ parameters ['title' ] = title
282
+ if self .apikey :
283
+ parameters ['key' ] = self .apikey
284
+ if self .appid :
285
+ parameters ['appid' ] = self .appid
286
+ resp = request ('http://cli.gs/api/v1/cligs/create' , parameters )
287
+ return resp .read ()
288
+
289
+ def expand (self , tinyurl ):
290
+ # TODO: debug this some more, not working properly
291
+ resp = request ('http://cli.gs/api/v1/cligs/expand' , {'clig' : tinyurl })
292
+ return resp .read ()
293
+
294
+ cligs = Cligs ()
295
+
271
296
"""Mapping of domain to service class"""
272
297
services = {
273
298
'sandbox' : sandbox ,
274
299
'tinyurl.com' : tinyurl ,
275
300
'tr.im' : trim ,
276
301
'urlborg.com' : urlborg , 'ub0.cc' : urlborg ,
277
302
'bit.ly' : bitly ,
278
- 'is.gd' : isgd
303
+ 'is.gd' : isgd ,
304
+ 'cli.gs' : cligs
279
305
}
280
306
281
307
"""
You can’t perform that action at this time.
0 commit comments