Stweet
Cyber Detective🇺🇦 • @cyb_detectivestweet
#opensource #python library for scraping tweets (by user, by hashtag, by keyword). no login or api key required.
github.com/markowanga/stweet
Quick manual 🧵🧵🧵⬇️ [#1]
1. (check that you have Python and PyPi installed)
2. Install Stweet:
pip install -U stweet
3. Create file main․py and copy code from README․md into it (view pic)
🧵 [#2]
Let's try to scrape tweets containing a certain hashtag:
Put target hashtag in "search_tweets_task = st.SearchTweetsTask(all_words='')" (If the tag is popular, scraping can take a long time)
Comment out the function call(#) for try_user_scrap and try_tweet_by_id_scrap
🧵 [#3]
Input in command line:
python main․py
After the script runs, check the files output_raw_search_tweets.jl (information about all tweets with target hashtag) and output_raw_search_users.jl (information about all users who used the target hashtag)
🧵 [#4]
Similarly, with Stweet, you can collect detailed information about user or tweet.
For easy JSON reading, you can quickly convert CSV with this tool:
convertcsv.com/json-to-csv.htm
🧵⬆️ [#5]