Created
December 16, 2009 08:36
-
-
Save mizchi/257684 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/python | |
#coding:utf-8 | |
import MeCab | |
import twitter | |
import os | |
import re | |
username="" | |
password="" | |
m = MeCab.Tagger('-Ochasen') | |
def say(text): | |
os.system("saykana "+text) | |
while 1: | |
tl=twitter.Api(username,password).GetFriendsTimeline() | |
for s in tl: | |
mes="" | |
for i in range(100): | |
try: mes+=m.parse(s.text.encode('utf-8')).rstrip('\n').split('\n')[i].split('\t')[1] | |
except:break | |
print ""+s.user.name+":"+ s.text | |
print mes | |
say(mes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment