Skip to content

Instantly share code, notes, and snippets.

@kurehajime
Created December 7, 2013 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurehajime/7844263 to your computer and use it in GitHub Desktop.
Save kurehajime/7844263 to your computer and use it in GitHub Desktop.
Pythonでニュース速報(嫌儲)のスレッド一覧を取得してみる。 ref: http://qiita.com/kurehajime/items/361ecab560d7f49f00b9
# -*- 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