How to get only native retweets with a search filter?
See original GitHub issueI am trying to get all the tweets (and their native retweets) tweeted by a new media account. I want to measure the impact of their tweets in time. I expect to produce this type of list of tweets to make data visualizations
author | text | timestamp |
---|---|---|
@newsmedia | Original tweet by newsmedia | - |
@oneuser | RT @newsmedia Original tweet by newsmedia | - |
@otheruser | RT @newsmedia Original tweet by newsmedia | - |
@newsmedia | Another Original tweet by newsmedia | - |
@onemoreuser | RT @newsmedia Another Original tweet by newsmedia | - |
So I’d need to filter to have the original tweets by the news media and the “nativeretweet” of those tweets
This is the query I am trying, that is not yet ready. I’d still need to add the filter to return only native retweets (like -filter:nativeretweets
) and include the original tweets by the news media user:
twarc2 search 'url:"twitter.com/eldiarioes"' --exclude-replies --start-time 2018-03-21T00:00:01 --end-time 2018-03-21T23:59:59 --archive > 2018-03-21_eldiario_rts.json
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Twitter Advanced Search - Complete guide on how to use it
On twitter advanced search, to filter tweets by date we will use the commands SINCE ... To search someone's tweets you just have...
Read more >Use Twitter Advanced search to find retweets made by a ...
As @AlexVong noted in the comments, you can find the new referential retweets by using: from:username include:nativeretweets filter: ...
Read more >Luca Hammer on Twitter: "By combining it with "filter:retweets ...
By combining it with "filter:retweets", you can search only through Retweets. Example: "filter:retweets include:nativeretweets from:luca" https://twitter.com/ ...
Read more >How to see only someone's original tweets on Twitter, filtering ...
Simply scroll down to your older tweets and click the retweet button as usual, selecting to either quote yourself - an opportunity to...
Read more >[QUESTION] apply "filter:nativeretweets" to search function #492
You are getting nothing because Twitter does not return retweets. ... In general, your command is correct! I'll add this feature as soon...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In that case, you would get the second - Twitter applies the AND operator first as specified in the docs: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query#order-of-operations
If in doubt it’s best to throw in brackets to make it explicit and more readable.
(This is also something that changed from V1.1 to V2, the OR used to have priority)
Yes, I managed to do it with your advice. Thanks again!
For the record, I used these scripts, working just with
twarc2 counts
, to download the amount of tweets of every news media I am studying. I realized I didn’t need the real tweets (though in parallel I am analyzing the tweets to check these results).All tweets by news media
twarc2 counts --archive '(from:elconfidencial)' --start-time 2018-03-20T00:00:00 --end-time 2018-05-01T23:59:59 --csv --granularity day > newsmedia.csv
All tweets by news media and search topic
twarc2 counts --archive '(from:elconfidencial cifuentes)' --start-time 2018-03-20T00:00:00 --end-time 2018-05-01T23:59:59 --csv --granularity day > newsmedia_topic.csv
All tweets by news media and their RT
twarc2 counts --archive '(from:elconfidencial OR retweets_of:elconfidencial)' --start-time 2018-03-20T00:00:00 --end-time 2018-05-01T23:59:59 --csv --granularity day > newsmedia-RT.csv
All tweets by news media and their RT and search topic
twarc2 counts --archive '( (from:elconfidencial OR retweets_of:elconfidencial) cifuentes)' --start-time 2018-03-20T00:00:00 --end-time 2018-05-01T23:59:59 --csv --granularity day > newsmedia-RT_topic.csv
Then with this other R script I processed all the data and generated visualizations like these ones:
For 1 news media:
Now I calculate the percentage for this news media in two ways:
All the news media together:
I also replicated these analysis by the hour and calculated their correlations.