README.md

ashr.rogue

Travis build status Coverage status lifecycle

The goal of ashr.rogue is to provide simple function which wraps httr package, function like GET will use random proxy and user agent with multiple try until got the right response.

Installation

You can install the released version of ashr.rogue with:

# install.packages('devtools')
devtools::install_github("ashther/ashr.rogue")

Example

# create a Rogue instance
rogue <- Rogue$new()
# or with proxy and user-agent, and record the proxy connection history
rogue <- Rogue$new(proxy = proxys, useragent = useragents, is_record = TRUE)
# select proxy not randomly, but consider the connection history, which means select better ones
rogue <- Rogue$new(proxy = proxys, useragent = useragents, is_record = TRUE, is_random = FALSE)

# add new proxy any time, and delete old ones
rogue$proxy_add(proxy_new, delete = TRUE)

# send query
rogue$get('http://httpbin.org/get')

# check the proxy connection history
rogue$proxy_show()


ashther/ashr.rogue documentation built on Aug. 3, 2019, 12:01 p.m.