4

I am currently accessing the Twitter API in R while relying on several access codes, I crowdsourced from my friends. However, Twitter seems to realise that the requests all come from the same IP, i.e. I can only use one code at a time.

So I was wondering whether there is any way in R to switch between different VPNs within my code? Are there any packages?

Thank you in advance!

1 Answers1

1

in Windows you can use the cmd rasdial like:

cmd <- unname(Sys.which("rasdial"))
cmd_args <- c('"VPN NAME"', userID, pass)
system2(command = cmd, args = cmd_args)

# Do your stuff

# Close the connection
cmd_args <- c('"VPN NAME"', '/DISCONNECT')
system2(command = cmd, args = cmd_args)
AleRuete
  • 313
  • 3
  • 7