Using a Proxy: PhantomJS with PersonaTool Business

If you have to automate some PhantomJS jobs and want to use PersonaTool Proxies: That is easy!

First of all: you will need a valid PersonaTool account to do the scripting and then it goes like this…

Activate a proxy with your PersonaTool account. You will need the crypted password from your sessions.json file in the PersonaTool directory: it is part of the JSON values and can be found for “pw”:…

Proxy Session File

On the shell, you have to activate the proxy with a call to the REST interface like this, once you have the value (please note, the values for password and the proxy IP have been changed to fantasy values):

wget "https://www.personatool.com/auto/proxyactivate.php?l=%7B%22login%22%3A%22puzzler%40gmail.com%22%2C%22pw%22%3A%22cc13e727a5afbacbf5be7668acfabaa5%22%7D&p=US-NORTHVIRGINA;54.75.214.141"

where the “l=” value comes as a URL encoded value set like:

encodeURIComponent('{"login":"'+ userSession.login +'","pw":"'+ userSession.pw +'"}');

and the “p=” value is the country and the IP of the PersonaTool proxy you want to activate.

The answer from the REST call should be “RULES LOADED”, once successful.

Use the proxy with PhantomJS like this:

phantomjs --proxy=54.75.214.141:443 --proxy-type=socks5 somescript.js

which should then call your script with the right proxy settings.

This way you can easily create a cronjob that checks specific settings via our proxies!