Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modules/crawling/tweets_crawling.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
import tweepy

# 트위터 개발자 계정에서 얻은 키들을 아래에 입력하세요.
def tweets_crawling(consumer_key, consumer_secret, access_token, access_token_secret, keyword):
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

# 특정 키워드가 포함된 트윗을 검색합니다.
public_tweets = api.search(q=keyword, lang="ko", count=5)

return public_tweets