Skip to content

Instantly share code, notes, and snippets.

@Blantas
Blantas / lootboy_cards_codes.js
Last active March 11, 2021 08:07
Format list of lootboy cards codes.
var AUTH_HEADER = 'Bearer ____'; // <<-- PASTE YOUR BEARER TOKEN HERE
// 1. Acquire your Bearer token from Network Tab in Developer Tools window in your browser, ie. https://i.imgur.com/RTzD1pX.png
// 2. Paste the token in the first line of the code ^
// 3. Finally, just paste the code in the Console tab: https://i.imgur.com/jMqtMZ4.png
// NEVER SHARE YOUR TOKEN PUBLICLY!
fetch('https://api.lootboy.de/v1/cards?lang=en', {method: 'GET',headers: {'authorization': AUTH_HEADER}})
.then(response => response.json())
.then(function(data){
var i = 1, r = '';
for(var p in data){