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
$ sudo pip install feedparser |
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
犬より猫が好きですか? 1.はい,0.いいえ :1 | |
理系ですか? 1.はい,0.いいえ :1 | |
パンよりご飯が好きですか? 1.はい,0.いいえ :1 | |
★あなたは男ですね?(確率52.50%) 1.はい,0.いいえ : |
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]) |
NewerOlder