-
Hi All, First of all, thank you for writing a really useful program. I hope it's okay to start a new discussion on this question. I looked through past discussions but didn't see anything on this. My question is, I wonder if it's possible to set limits on the number of Tweets returned by the get_liked_tweets function? That is, either setting limits by date (starting or ending date) or total number (say, a maximum of 10k). I ask because I'm currently using this function to see whether certain political elites are liking each others Tweets. I have a for loop that goes through and pulls the liked Tweets for each individual in a list. The problem arises when some individuals have in the range of 150,000 liked Tweets. Given the rate limits set by Twitter, it takes hours to download these Tweets and eats up my total monthly allowance. For these individuals, it would be great if I could set a maximum of 10k or 20k returned Tweets. Is that possible? I looked in the documentation for academictwitteR and Twitter's documentation for the liked_tweets endpoint, and didn't see any options for setting limits like this, but it's possible I missed it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay, I figured it out. I created a custom First, I added a few new lines to the
That works to stop at 30,000 Tweets. That number could be changed to any preference. I suppose it could also be written as an additional argument so you could change the number without needing to edit the function. Then, I told academictwitteR to use the custom function.
That's it! Now, when I'm retrieving liked Tweets the process stops if/when it reaches 30,000. If it doesn't reach that amount then everything is the same. |
Beta Was this translation helpful? Give feedback.
Okay, I figured it out. I created a custom
get_user_edges
function and then told academictwitteR to use it instead of the original.First, I added a few new lines to the
get_user_edges
function. I put them below the if clause that checks if the next token is null. I'm including the whole code chunk here: