We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent71f77cc commit773efa8Copy full SHA for 773efa8
services/chilpit.py
@@ -14,25 +14,22 @@ def shrink(self, bigurl):
14
raiseShortyError(url)
15
16
defexpand(self,tinyurl):
17
-Service.expand(self,tinyurl)
18
-
19
-# needs fixing
20
-"""turl = urlparse(tinyurl)
+turl=urlparse(tinyurl)
21
ifturl[1].lstrip('www.')!='chilp.it':
22
raiseShortyError('Not a chilp.it url')
23
- resp = request('http://p.chilp.it/api.php?' + turl[4])
+resp=request('http://p.chilp.it/api.php?'+turl[2][1:])
24
url=resp.read()
25
ifurl.startswith('http://'):
26
returnurl.strip('\n\r')
27
else:
28
- raise ShortyError(url)"""
+raiseShortyError(url)
29
30
# get click stats of the tinyurl
31
defstats(self,tinyurl):
32
turl=urlparse(tinyurl)
33
34
35
-resp=request('http://s.chilp.it/api.php?'+turl[4])
+resp=request('http://s.chilp.it/api.php?'+turl[2][1:])
36
hit_count=resp.read()
37
try:
38
returnint(hit_count)