Last change
on this file since 33 was
33,
checked in by simon, 17 years ago
|
- Added tool to grab linkpot URLs.
|
-
Property svn:executable set to
*
|
File size:
389 bytes
|
Rev | Line | |
---|
[33] | 1 | #!/usr/bin/env python |
---|
| 2 | |
---|
| 3 | import urllib |
---|
| 4 | import re |
---|
| 5 | |
---|
| 6 | pot_re = re.compile(r'Your quick url is <a href="(http://linkpot.net/.*?)"') |
---|
| 7 | |
---|
| 8 | def linkpot(url): |
---|
| 9 | post_data = urllib.urlencode({'url': url}) |
---|
| 10 | res = urllib.urlopen('http://linkpot.net/add/', post_data).read() |
---|
| 11 | pot = pot_re.search(res).group(1) |
---|
| 12 | return pot |
---|
| 13 | |
---|
| 14 | if __name__ == '__main__': |
---|
| 15 | import sys |
---|
| 16 | print linkpot(sys.argv[1]) |
---|
| 17 | |
---|
Note: See
TracBrowser
for help on using the repository browser.