title: How to use cursoring with get_timeline for many users?
body: <p>I am trying to get the timelines (last 3200 tweets) of a large number of Twitter users using the <code>rtweet</code> <code>get_timeline</code> function.</p>
  <p>After a given number of requests, you need to stop for 15 minutes.</p>
  <p>The problem is the following. Typically, the rate limit is reached halfway in a user timeline. Then, how do I resume downloading tweets from the last tweet I requested for that user?</p>
  <p>Since some users have fewer than 3200 tweets, I cannot determine after how many users the rate limit will be reached.</p>
  <p>I guess cursoring would be the solution here, but I can't wrap my head around how to use it.</p>
  <p>This is a stripped-down example of the code that I am using.</p>
  <pre><code>i &lt;- 1
  
  # screen_names is a vector of Twitter screen_names
  for (sn in screen_names){
  
     tryCatch(
  
      tl[i] &lt;- get_timeline(sn, n = 3200),
  
      warning = function(w){
  
          Sys.Sleep(15 * 60)
  
      }
  
  i &lt;- i + 1
  
  }
  </code></pre>