Last active
June 30, 2022 10:29
-
-
Save veryyoung/5ce6cca6e3b2462084fe9d9417afa947 to your computer and use it in GitHub Desktop.
Check premint raffle result using Tampermonkey
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
// ==UserScript== | |
// @name PreMint-UI | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author MurMurCats - LL | |
// @match https://www.premint.xyz/collectors/entries/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net | |
// @require https://unpkg.com/[email protected]/dist/jquery.min.js | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
$(function () { | |
const urlRoot = 'https://www.premint.xyz'; | |
let urlList = []; | |
let i = 0; | |
let targetUrl = ''; | |
let responseHtmlElement = null; | |
let t1 = ''; | |
let t2 = ''; | |
$(".card-image a").each(function () { | |
urlList[i] = urlRoot + $(this).attr("href") + "verify/"; | |
$(this).attr("href", urlList[i]) | |
i++ | |
}); | |
for (let q = 0; q < i; q++) { | |
GM_xmlhttpRequest({ | |
method: 'GET', | |
url: urlList[q], | |
onload: function (res) { | |
if (res.status === 200) { | |
responseHtmlElement = res.responseText; | |
t1 = $(".heading.heading-1", responseHtmlElement).get(1); | |
t2 = $(".heading.heading-3.mb-3", responseHtmlElement).get(0) | |
$(".card-image").get(q).append($(t1).html()); | |
$(".card-image").get(q).append($(t2).html()); | |
} else { | |
console.log('error, res.status = ', res.status); | |
} | |
}, | |
onerror: function (err) { | |
console.log('err', err); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment