Forked from nenadpoznanovichtec/gist:53407db3323cfd6424cdf46a4d580883
Created
December 18, 2021 02:03
-
-
Save dtmrc/b2ac62ca473dbd54530658c3f668b17f to your computer and use it in GitHub Desktop.
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
// 1. prvi deo koda kopiras u konzolu na https://solanart.io/collections/solanaslugs | |
// - ako zelis vise slugova, moras da skrolujes dole da ih sve ucita | |
// zatim kopiraj ovaj code ga u konzolu: | |
const slugArray = Array.from(document.querySelectorAll('.card-title')) | |
const copy = slugArray.map(e => Number(e.outerText.split(" - ")[1])) | |
copy | |
// to sto ti izbaci kao rezultat, ides desni klik i "copy object" | |
// 1.1 ako pratis sa ovog marketa https://magiceden.io/marketplace/sol_slugs, onda ide ovako skripta | |
const slugArray = Array.from(document.querySelectorAll('.mb-0.tw-truncate')) | |
const copy = slugArray.map(e => Number(e.outerText.split(" - ")[1])) | |
copy | |
// 2. ovaj drugi deo kopiras na https://solslugs.com/rankings | |
// unutar konzole i dobijes sortiranu listu poredjanu po rangovima: | |
var inputSlug = document.getElementById('slug-input'); | |
var inputRank = document.getElementById('rank-input'); | |
// u slugArray varijablu kopiras to sto si dobio iz prethodne skripte | |
var slugArray = | |
var getRanking = function(slugArray) { | |
var allRankPairs = []; | |
var pair; | |
slugArray.forEach(function(el) { | |
inputSlug.value = el; | |
inputSlug.dispatchEvent(new KeyboardEvent('keyup')); | |
pair = { | |
rank: Number(inputRank.value), | |
slug: el | |
} | |
allRankPairs.push(pair); | |
}) | |
return allRankPairs.sort(function (a, b) { | |
return a.rank - b.rank; | |
}); | |
} | |
getRanking(slugArray) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment