Skip to content

Instantly share code, notes, and snippets.

@mizchi
Created December 16, 2009 08:36
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 mizchi/257684 to your computer and use it in GitHub Desktop.
Save mizchi/257684 to your computer and use it in GitHub Desktop.
#! /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