저는 프로그래밍의 초보자입니다.하지만 제 문제로 저를 도울 수 있기를 바랍니다. tweepy/python/stream.api 및 R (통계 프로그램)을 사용하여 트윗을 분석하려고합니다.tweepy 출력을 Excel로 가져 오는 방법은 무엇입니까?
오른쪽 스트림 수신기가 작동 알고 있지만 내가 출력을 사용할 수 없습니다 ...
이것은 내가 실행 해요 스크립트입니다 :
import tweepy
consumer_key="..."
consumer_secret="..."
access_key = "..."
access_secret = "..."
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
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=['...'])
결과는, 내가 돈 ' 전체 트윗 (처음 50 자만)을 얻지 못하고 트위터가 열리는 시간을 볼 수 없습니다. 어떻게하면이 문제를 해결할 수 있으며 출력을 Excel 파일로 "인쇄"할 수 있습니까?
. 나는 tweepy 웹 사이트 만 스캔했는데 아직도 사피가 어떤 종류의 물체인지 궁금해합니다. 질문에 실제 열쇠가 있습니까? 여기에 표시해야 할 열쇠가 있습니까? – PyNEwbie
전 세계가 볼 수 있도록 consumer_key, consumer_secret, access_key 및 access_secret을 게시해도 괜찮습니까? –
나는 그 (그가 누락 된 닫는 따옴표) 따라서 그들을 잘라 의심하지만 어쨌든 그 구문 하이라이트 나를 미치게했기 때문에 ^^ – poke