setHandleParameters: If 'gtrends' should be used behind a proxy, especially with...

Description Usage Arguments Examples

View source: R/setHandleParameters.R

Description

If gtrends should be used behind a proxy, especially with NTLM authentication mode, you need to set the proxy parameters and credentials using "setHandleParameters" function

Usage

1
2
3
4
5
6
7
8
9
setHandleParameters(
  user = NULL,
  password = NULL,
  domain = NULL,
  proxyhost = NULL,
  proxyport = 8080,
  proxyauth = 15,
  extra_curl_opts = list()
)

Arguments

user

A string specifying your username

password

A string specifying your password

domain

A string specifying the authentication domain

proxyhost

A string specifying the Proxy host DNS or IP address

proxyport

A numeric specifying the Proxy Port : 8080 (default)

proxyauth

A numeric specifying the Proxy Authentication Method : 0 for NONE 1 for BASIC 2 for DIGEST 4 for NEGOTIATE 8 for NTLM 15 for ANY (default)

extra_curl_opts

A list of additional named options to pass into curl::handle_setopt(), e.g. list(timeout=60)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(gtrendsR)

setHandleParameters(user="xxxx",password="*******",domain="mydomain",proxyhost = "10.111.124.113")
res <- gtrends(c("nhl", "nba"), geo = c("CA", "US"))

# include additional curl options
setHandleParameters(user="xxxx",
                    password="*******",
                    domain="mydomain",
                    proxyhost = "10.111.124.113",
                    extra_curl_opts=list(timeout=60))

## End(Not run)

gtrendsR documentation built on Feb. 23, 2021, 5:13 p.m.