Skip to content

Instantly share code, notes, and snippets.

@kurozumi kurozumi/
Last active Oct 16, 2015

What would you like to do?
import urllib
import urllib2
import os
from cookielib import LWPCookieJar
class Hatebu():
def __init__(self):
self.cookiefile = "cookies.txt"
self.cj = LWPCookieJar()
if os.path.exists(self.cookiefile):
self.opener = urllib2.build_opener()
def __del__(self):
def request(self, url, postdata):
postdata = urllib.urlencode(postdata)
return urllib2.Request(url, postdata)
def login(self, postdata):
url = "", postdata))
def read(self, url, postdata=""):
response =, postdata))
if __name__ == '__main__':
hatebu = Hatebu()
"name": "username",
"password": "password"
url = ""
content =
print content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.