Last active
August 27, 2019 10:54
-
-
Save barthr/d4c1230ae75346739226952e214a22bd to your computer and use it in GitHub Desktop.
Javascript Ticketswap crawler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var current = window.location.href; | |
var party_url = "";//Typ hier je Feest url | |
var base_url = "https://www.ticketswap.nl"; | |
$( document ).ready(function() { | |
if (current.indexOf("event") > -1) { | |
refreshPage(); | |
} | |
else if (current.indexOf("listing") > -1){ | |
orderCard(); | |
} | |
}); | |
function refreshPage() { | |
var listed = $("section.listings"); | |
if (listed.length > 1) { | |
listed.find("article").find("a")[0].click(); | |
} | |
setTimeout( | |
function() | |
{ | |
location.reload(); | |
}, 11500); | |
} | |
function orderCard() { | |
var button = $("div.block").find("a"); | |
if (button.text().indexOf("Koop") > -1 ){ | |
window.location.href=base_url+button.attr('href'); | |
}else { | |
setTimeout( | |
function() | |
{ | |
window.location.href=party_url; | |
}, 5000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment