Created
December 7, 2013 15:55
-
-
Save kurehajime/7844263 to your computer and use it in GitHub Desktop.
Pythonでニュース速報(嫌儲)のスレッド一覧を取得してみる。 ref: http://qiita.com/kurehajime/items/361ecab560d7f49f00b9
This file contains 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
# -*- coding: utf-8 -*- | |
import urllib | |
def get_kenmo(): | |
response = urllib.urlopen('http://engawa.2ch.net/poverty/subject.txt') | |
html = unicode(response.read(), "cp932", 'ignore').encode("utf-8") | |
for line in html.split("\n"): | |
if line != "": | |
print(line.split("<>", 2)[1]) | |
if __name__ == "__main__": | |
get_kenmo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment