Description Usage Arguments Value Scroll sleep WARNING
View source: R/screen_scrape_tweets.R
Function takes remote driver currently at a Twitter users' stream, and scrolls till no more new tweets, replies, quotes, etc. are loaded (i.e., until the "Back to top ↑" icon is displayed). It then extracts all tweet IDs from the HTML source (tag 'div.tweet', attribute 'data-item-id'), and returns them as a character vector.
1 | scroll_more_tweets(account, remdr, max.scrolls = 30L, sleep = 0.5)
|
account |
Twitter screen name or account ID |
remdr |
an active RSelenium |
max.scrolls |
Maximun number of times down-scrolling is tried. Defaults to 30. |
sleep |
number of second to pause between down-scroll trials. Defaults to .5 |
A character vector of tweet IDs.
Argument sleep
determines how much the Twitter timeline has to fully load.
WARNING: Setting low values (<.75 seconds) endangers not getting all tweet IDs,
as the scraping process can be aborted prematurely due to too little scroll sleep.
The default setting of .75 seconds is a minumum with fast internet connection.
Function presuposses an active remote Selenium driver.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.