I have to perform a full archival research on tweets about Malaysian Environmental change, challenges and solutions. I am a social science researcher with very less coding experience. I am trying for many days to do the research but I am unable to get good results. If you can write me a full working code to get tweets as I have tight deadline to collect data. I need a full working code to get tweets about malaysia regarding environment change.
I am trying to use this query
Malaysia (environment OR climate OR global warming OR pollution OR litter OR plastic OR waste OR deforestation OR sustainability OR palm oil OR carbon)
Please help as I am badly stuck.
I recommend using twarc for this:
That should get you started.
In your query, you may get wrong results because there’s a space in global warming or palm oil so you should use " to create a phrase, but in command line this may mess it up, so use PowerShell in windows or bash in Linux or OSX to run commands so you can “escape” the " with a \" like this:
twarc2 search --start-time "2022-04-01" --end-time "2022-04-30" --archive "Malaysia (environment OR climate OR \"global warming\" OR pollution OR litter OR plastic OR waste OR deforestation OR sustainability OR \"palm oil\" OR carbon)"
(You need academic access to get tweets from more than 7 days ago, and specify --archive otherwise leave this part out)