githug level14で詰まった

詰まったのでメモ
こちらを見て解決しました.
https://github.com/Gazler/githug/issues/70

要するに.gitignoreを作る課題のところで.gitignore自体はすでに中身付きで存在するので,

echo *.swp > .gitignore

とかやっちゃうともともとの中身が消えちゃうってうまく行かなくなるとのこと.
.gitignoreの中を

.profile.yml
.gitignore
*.swp

になおして

githug reset

して再度level14に臨んで見ましょう.

tweepy使用,public streamを垂れ流す

#coding:utf-8

import tweepy
import sys

consumer_key = ''
consumer_secret = ''
access_key = ''
access_secret = ''

class StreamListener(tweepy.StreamListener):
    def on_status(self, status):
        if sys.argv[1].decode('utf-8') in status.text:
            print (status.user.screen_name+' : '+status.text.encode('utf-8'))

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)

stream = tweepy.Stream(auth, StreamListener())
stream.sample()

コピペですが.
http://newbienewbie.wordpress.com/2011/04/16/twitterのstreaming-apiを試してみる/
スクリプトに引数として単語を渡すとそれを含むtweetをpublic streamから拾ってくる.