mixiã®æ´æ°æ å ±ãRSSã§åå¾
ãã¿ããªãã®ã§ææ¸ããã¹ã¯ãªãããè²¼ã£ã¦ã¿ã¾ãã
mixiã®æ´æ°æ å ±ãRSSã§åå¾ããããªã¼ã¨æã£ã¦ãmixipressã使ã£ã¦ã¿ãã¨ããåããªãã£ãã®ã§ãmixi stationç¨APIã使ã£ã¦ç°¡åã«æ¸ãã¾ãããèªè¨¼ã«ã¯cookieã使ã£ã¦ã¾ãã
#!/usr/bin/env python # -*- coding: euc-jp -*- import urllib, urllib2, cookielib username = 'mixiã®ã¡ã¼ã«ã¢ãã¬ã¹' password = 'mixiã®ãã¹ã¯ã¼ã' mixiid = 'mixiã®id(ãããã£ã¼ã«æ¬ã«ãã475205ã¿ãããªæ°å)' cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) opener.addheaders = [('User-agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)')] params = urllib.urlencode({'email': username, 'password': password, 'next_url': 'home.pl'}) handle = opener.open('http://mixi.jp/login.pl', params) try: print "Content-type: text/xml\n" print opener.open('http://mixi.jp/atom/updates/r=1/member_id=%s/-/diary' % mixiid).read() except urllib2.HTTPError, e: print "Content-type: text/html\n\n" print "Error: %s" % e.read()
pythonãåãé©å½ãªãµã¼ãã¼ã«ã¹ã¯ãªããç½®ãã¦ãRSSãªã¼ãã¼ã«ç»é²ããã°ä½¿ãã¾ãã