I recently had to upgrade my skills on getting dates and time. If you are not a programmer you may think that dates and time should be real simple. If you do program you know that it's aggravating to manipulate the Date object.
Anyway, I wanted to make something better than "Hello Date". I remembered the Alex Jones show stores all of it's podcasts as dates so, I tied my date experiment into a little app that gets the most recent fully recorded AJ show. I know it's dumb and pointless but, I made it and it works.
If you actually want to use/try this, simply copy and paste the code into wordpad and save it as whateverYouWant.html...open it with your browser. I put ZERO effort into any kind of art or UI. When you open the page you get a message and a link...that's it. I didn't even change the background color.
EDIT: I do not support or care about Alex Jones. His podcast URLs and the Date modifications necessary to concoct them fell well within my experiments and were used for that reason.
Anyway, I wanted to make something better than "Hello Date". I remembered the Alex Jones show stores all of it's podcasts as dates so, I tied my date experiment into a little app that gets the most recent fully recorded AJ show. I know it's dumb and pointless but, I made it and it works.
Code:
<!DOCTYPE html> <html> <head> <title>Most Recent Fully Recorded Alex Jones Show</title> <script> var weekdays = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]; var d = new Date(); var y = new Date(); function getURL(){ var wkd = weekdays[d.getDay()]; var lnk; if((d.getHours() < 16) || (wkd == "Sat")) { if(wkd == "Sun")lnk = getDay(2); else lnk = getDay(1); document.getElementById("disp").innerHTML = "It's either Saturday or before 4pm central. A link to the last available show has been created for you."; } else lnk = getDay(0); document.getElementById("link").href = "http://rss.infowars.com./"+lnk+"_Alex.mp3"; document.getElementById("link").innerHTML = lnk+"_Alex.mp3"; } function getDay(n) { y.setDate(d.getDate() - n); var m = y.getMonth()+1; var year = y.getFullYear(); var month = (m < 10)?"0"+m:""+m; var day = y.getDate(); var weekday = weekdays[y.getDay()]; return (year+month+day)+"_"+weekday; } </script> </head> <body onload="getURL()"> <p id="disp">Right-click and select "save target as.." to download or left-click to open in your browser</p> <a id="link"></a> </body> </html>
EDIT: I do not support or care about Alex Jones. His podcast URLs and the Date modifications necessary to concoct them fell well within my experiments and were used for that reason.
Comment