Skip to content

Commit 2e4015f

Browse files
author
Sam Hames
committed
Add some more explanatory docs about the like* and retweeted_by commands
1 parent 3778a77 commit 2e4015f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/twarc2_en_us.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,32 @@ conversation:
227227

228228
twarc2 conversation 266031293945503744 > conversation.jsonl
229229

230+
## Likes
231+
232+
Twarc supports the two approaches that the Twitter API exposes for collecting likes via the `liked_tweets` and `liking_users` commands.
233+
234+
The `liked_tweets` command returns the tweets that have been liked by a specific account. The account is specified by the user ID of that account, in the following example is the account of Twitter's founder:
235+
236+
twarc2 liked_tweets 12 jacks_likes.jsonl
237+
238+
In this case the output file contains all of the likes of publicly accessible tweets. Note that the order of likes is not guaranteed by the API, but is probably reverse chronological, or most recent likes by that account first. The underlying tweet objects contain no information about when the tweet was liked.
239+
240+
The `liking_users` command returns the user profiles of the accounts that have liked a specific tweet (specified by the ID of the tweet):
241+
242+
twarc2 liking_users 1460417326130421765 liking_users.jsonl
243+
244+
In this example the output file contains all of the user profiles of the publicly accessible accounts that have liked that specific tweet. Note that the order of profiles is not guaranteed by the API, but is probably reverse chronological, or the profile of the most recent like for that account first. The underlying profile objects contain no information about when the tweet was liked.
245+
246+
Note that likes of tweets that are not publicly accessible, or likes by accounts that are protected will not be retrieved by either of these methods. Therefore, the metrics available on a tweet object (under the `public_metrics.like_count` field) will likely be higher than the number of likes you can retrieve via the Twitter API using these endpoints.
247+
248+
## Retweets
249+
250+
You can retrieve the user profiles of publicly accessible accounts that have retweeted a specific tweet, using the `retweeted_by` command and the ID of the tweet as an identifier. For example:
251+
252+
twarc2 retweeted_by 1460417326130421765 retweeting_users.jsonl
253+
254+
Unfortunately this only returns the user profiles (presumably in reverse chronological order) of the retweeters of that tweet - this means that important information, like when the tweet was retweeted is not present in the returned object.
255+
230256
## Dehydrate
231257

232258
The `dehydrate` command generates an id list from a file of tweets:

0 commit comments

Comments
 (0)