Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var USERNAME = 'juuhelikkas15';
- var PASSWORD = 'juuhelikkas15';
- var page = require('webpage').create();
- page.open('http://www.dalaran-wow.com/', function(status) {
- console.log('/: ' + status);
- if (status !== 'success') {
- phantom.exit();
- } else {
- setTimeout(function() {
- login();
- setTimeout(function() {
- vote(1);
- }, 10000)
- }, 10000);
- }
- });
- function login() {
- page.open('http://www.dalaran-wow.com/loginframe.php', function(status) {
- console.log('/loginframe.php: ' + status);
- setTimeout(function() {
- page.evaluate(function(cred) {
- document.getElementById('accountName').value = cred.u;
- document.getElementById('password').value = cred.p;
- $(document.querySelector('.button1')).click();
- }, {u: USERNAME, p: PASSWORD});
- }, 3000);
- })
- }
- function vote(i) {
- var max = 4;
- if (i > max) {
- phantom.exit();
- }
- page.open('http://www.dalaran-wow.com/account/vote/' + i, function(status) {
- console.log('/account/vote/' + i + ': ' + status);
- if (status !== 'success') {
- phantom.exit();
- } else {
- setTimeout(function() {
- vote(i + 1);
- }, 10000);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement