.
class CustomStreamListener(tweepy.StreamListener):
def on_status(self, status):
print status.text
print status.user.screen_name #<----------------THIS LINE
당신을 트위터 사람을 보여줍니다 :
당신은 추가하여 트윗 사람에 액세스 할 수 있습니다. 당신은을 만들어야합니다
import tweepy
consumer_key = "xxx"
consumer_secret = "xxx"
access_key = "xxx"
access_secret = "xxx"
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api = tweepy.API(auth)
class CustomStreamListener(tweepy.StreamListener):
def on_status(self, status):
print status.text
print status.user.screen_name
api.update_status("Insert Auto Reply Text Here", in_reply_to_status_id = status.id)
def on_error(self, status_code):
print >> sys.stderr, 'Encountered error with status code:', status_code
return True # Don't kill the stream
def on_timeout(self):
print >> sys.stderr, 'Timeout...'
return True # Don't kill the stream
sapi = tweepy.streaming.Stream(auth, CustomStreamListener())
sapi.filter(track=['@rishi'])
: 같은
status.id
코드가 같아야합니다
api.update_status("my update", in_reply_to_status_id = tweetid)
트윗 ID를 사용하여 입수 할 수 있습니다 : 당신은 다음의 사용 상태를 업데이트 할 수 있습니다 dev 트위터 계정이 작동하고 자신의 보안 토큰을 입력하십시오. 저는 현재 광산이 읽기 전용이기 때문에 타임 라인에 테스트 쓰기를 할 수 없습니다.