Created
June 25, 2012 09:19
-
-
Save borman/2987595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from urllib.request import quote | |
| import urllib3 | |
| from lxml import etree | |
| http = urllib3.PoolManager() | |
| def getFriends(uname): | |
| r = http.request('GET', 'http://juick.com/%s/friends' % quote(uname)) | |
| t = etree.HTML(r.data) | |
| friends = t.xpath('/html/body/div[@id="wrapper"]/div[@id="content"]/p/a[@class="p16"]/text()') | |
| return friends | |
| def getReaders(uname): | |
| r = http.request('GET', 'http://juick.com/%s/readers' % quote(uname)) | |
| t = etree.HTML(r.data) | |
| readers = t.xpath('/html/body/div[@id="wrapper"]/div[@id="content"]/p/a[@class="p16"]/text()') | |
| return readers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment