Skip to content

Instantly share code, notes, and snippets.

@borman
Created June 25, 2012 09:19
Show Gist options
  • Save borman/2987595 to your computer and use it in GitHub Desktop.
Save borman/2987595 to your computer and use it in GitHub Desktop.
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