ROGUE: Object to make http request

Description Usage Arguments Details

Description

Make http request with random proxy and useragent, try until got the response in specific max iter times.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rogue <- Rogue$new(proxy = proxy, useragent = useragent, iter_max = 10,
                   is_record = TRUE, is_random = FALSE, is_quite = FALSE)

rogue$proxy_add(proxy, delete = FALSE)
rogue$proxy_show()

rogue$get(...)
rogue$post(...)
rogue$put(...)
rogue$delete(...)

Arguments

proxy

proxy list, with ip and port elements at least, the object initialization process will check the list, times element will be append if it does not exist, and the value is 1

useragent

multiple user agent character vector

iter_max

the max times to try send the http request, it should be not bigger than the length of proxy list

is_record

if record the history of connecting to proxy, the result will be used in select better proxy

is_random

if select proxy based on the probability, which is the successful connecting times for each proxy

is_quite

if output the error message when try to connect proxy

delete

if delete old and worse proxy when add new ones

...

arguments send to function of httr package

Details

Rogue$new() creates a new Rogue object.

rogue$proxy_add() add new proxy for requesting.

rogue$proxy_show() show the proxy connecting history in tibble format.

rogue$get() send get request to server.

rogue$post() send post request to server.

rogue$put() send put request to server.

rogue$delete() send delete request to server.


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