NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// ==UserScript==
// @name AddHTML
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the world!
// @author You
// @include https://control.lotto.pl/gov/private/*
// @include https://plt-cat-control.lotto.pl/gov/private/*

// @require https://gist.github.com/raw/2625891/waitForKeyElements.js




// ==/UserScript==
waitForKeyElements(
"select[name*='campaignPlayerRewardsList_length']",
addOption
);

function selectElement(valueToSelect) {
let element = document.getElementsByName('campaignPlayerRewardsList_length')[0];
element.value = valueToSelect;
}

function download_csv(csv, filename) {
var csvFile;
var downloadLink;

// CSV FILE
csvFile = new Blob([csv], {
type: "text/csv"
});
// Download link
downloadLink = document.createElement("a");
// File name
downloadLink.download = filename;
// We have to create a link to the file
downloadLink.href = window.URL.createObjectURL(csvFile);
// Make sure that the link is not displayed
downloadLink.style.display = "none";
// Add the link to your DOM
document.body.appendChild(downloadLink);
// Lanzamos
downloadLink.click();
}

function export_table_to_csv(html, filename) {
var csv = [];
var transactionid;
var price;
// document.getElementById('downloadall').innerHTML = "Pobieranie, prosze czekac.....";
//problem z ID transakcji
$("#campaignPlayerRewardsList_length > label > select").val("1000000").change();
transactionid = document.querySelectorAll('span[data-toggle]').forEach(el => el.setAttribute('style', 'display: none;'));
price = document.querySelectorAll('#campaignPlayerRewardsList tr td:nth-of-type(3), #campaignPlayerRewardsList tr td:nth-of-type(5)');
for (var l = 0; l < price.length; l++) {
price[l].innerHTML = price[l].innerHTML.replace('.', ',');
}


var rows = document.querySelectorAll("#campaignPlayerRewardsList tr");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td, th");
for (var j = 0; j < cols.length; j++)
row.push(cols[j].innerText);

csv.push(row.join(";"));
}
$("#campaignPlayerRewardsList_length > label > select").val("5").change();
transactionid = document.querySelectorAll('span[data-toggle]').forEach(el => el.removeAttribute('style'));
price = document.querySelectorAll('#campaignPlayerRewardsList tr td:nth-of-type(3), #campaignPlayerRewardsList tr td:nth-of-type(5)');
for (l = 0; l < price.length; l++) {
price[l].innerHTML = price[l].innerHTML.replace(',', '.');
}
// Download CSV
download_csv(csv.join("n"), filename);
}

function addOption(navbar) {
navbar = document.getElementsByName('campaignPlayerRewardsList_length')[0];
console.log(navbar);
if (navbar) {
var element = document.createElement("option");
element.setAttribute("value", "100");
element.innerHTML = 100
navbar.appendChild(element);
var element2 = document.createElement("option");
element2.setAttribute("value", "500");
element2.innerHTML = 500
navbar.appendChild(element2);
var element3 = document.createElement("option");
element3.setAttribute("value", "1000");
element3.innerHTML = 1000
navbar.appendChild(element3);
var element4 = document.createElement("option");
element4.setAttribute("value", "5000");
element4.innerHTML = 5000
navbar.appendChild(element4);
var element5 = document.createElement("option");
element5.setAttribute("value", "100000");
element5.innerHTML = 100000
navbar.appendChild(element5);
var element6 = document.createElement("option");
element6.setAttribute("value", "1000000");
element6.innerHTML = 1000000
navbar.appendChild(element6);

}
var tab = document.getElementById('campaignPlayerRewardsList_wrapper');
tab.style["overflow"] = "scroll";
tab.style["height"] = "80%";


var list = document.getElementById('campaignPlayerRewardsList_length');
var addButton = document.createElement("button");
addButton.setAttribute("id", "downloadall");
addButton.setAttribute("href", "#");
addButton.innerHTML = 'Pobierz';
addButton.addEventListener("click", function() {
var html = document.querySelector("#campaignPlayerRewardsList").outerHTML;
export_table_to_csv(html, "rewards_export.csv");
})
list.appendChild(addButton);

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.