scroll_more_tweets: Scroll for more tweets

Description Usage Arguments Value Scroll sleep WARNING

View source: R/screen_scrape_tweets.R

Description

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.

Usage

1
scroll_more_tweets(account, remdr, max.scrolls = 30L, sleep = 0.5)

Arguments

account

Twitter screen name or account ID

remdr

an active RSelenium remoteDriver object (check remdr$getStatus() to see if the driver is running.)

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

Value

A character vector of tweet IDs.

Scroll sleep

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.

WARNING

Function presuposses an active remote Selenium driver.


haukelicht/twscrape documentation built on Jan. 29, 2020, 3:23 p.m.