Last active
September 25, 2015 16:08
-
-
Save pastak/948521 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
/*load jQuery*/ | |
var s=document.createElement("script"); | |
thisyear=(new Date()).getFullYear(); | |
s.src="https://raw.github.com/jquery/jquery/master/speed/jquery-basis.js"; | |
s.addEventListener("load",function(){ | |
var month,day,subject,year,data="Subject,Start Date,Start Time\n"; | |
$(".hyo_table").each(function(m,table){ | |
month=(m+4)%12 ? (m+4)%12 : 12; | |
year=month>3 ? thisyear : (thisyear+1); | |
$(table).children().children().each(function(i,tr){ | |
day=parseInt($(tr).children(".hyo_date:last").text()); | |
subject=$(tr).children(".hyo_subject").text(); | |
subjects=subject.split("/"); | |
for(i in subjects){ | |
data+=(subjects[i]+","+year+"/"+month+"/"+day+",TRUE \n"); | |
} | |
}) | |
}) | |
console.log(data); | |
/*download file and save as csv | |
window.open("data:plain/text,"+data,null); | |
*/ | |
},true) | |
document.body.appendChild(s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment