Skip to content

Instantly share code, notes, and snippets.

@barthr
Last active August 27, 2019 10:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save barthr/d4c1230ae75346739226952e214a22bd to your computer and use it in GitHub Desktop.
Save barthr/d4c1230ae75346739226952e214a22bd to your computer and use it in GitHub Desktop.
Javascript Ticketswap crawler
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