Last active
October 31, 2019 14:59
-
-
Save mahmut-gundogdu/ebac0955ccfd8e2d5bfd56eb4b2caeaa to your computer and use it in GitHub Desktop.
Otomatik giriş çıkışlar için ek araç https://gist.github.com/mahmut-gundogdu/83e3e531369d19a88db8d0e33693836c
This file contains 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
moment.lang("tr") | |
var mainElement = $("#ctl00_ctl60_g_86ee7db6_7073_42c5_9737_7005e352da4c .container" )[0] | |
var result = []; | |
$(mainElement.children).each(function(a,b){ | |
var row = [] | |
$(b.children).each(function(x,y){ | |
row.push(y.innerText) | |
}); | |
var date = row[0].split(' '); | |
date.pop(); | |
row[0] = moment(date.join(' '),'DD MMMM YYYY').format('DD-MM-YYYY'); | |
if(row.length > 3) | |
row = [row[0],row[1],row[row.length - 1],...row.splice(1,row.length) ] | |
result.push(row.join(';')) | |
}) | |
var csvContent = "data:text/csv;charset=utf-8,"; | |
csvContent += "Tarih;Giris;Cikis\r\n" | |
csvContent += result.join('\r\n'); | |
//console.log(csvContent) | |
var link = document.createElement("a"); | |
link.setAttribute("href", csvContent); | |
link.setAttribute("download", "giris-cikis.csv"); | |
document.body.appendChild(link); // Required for FF | |
link.click(); // This will download the data file named "giris-cikis.csv". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment