Skip to content

Instantly share code, notes, and snippets.

@Mike-Dunton
Last active May 15, 2017 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mike-Dunton/cd99f4e32e1f3de9126e37e969df8428 to your computer and use it in GitHub Desktop.
Save Mike-Dunton/cd99f4e32e1f3de9126e37e969df8428 to your computer and use it in GitHub Desktop.
Bookmarklet to check what you won in lucky money
// Runs on flalottery.com
// http://www.flalottery.com/site/winningNumberSearch?searchTypeIn=number&gameNameIn=LUCKYMONEY&n1In=2&n2In=3&n3In=4&n4In=5&lbIn=1&
//
// Add the Following Javascript bookmarklet to your bookmarks.
// Click the bookmark while you are on your winningNumbers Search results for your numbers.
// Check Console for output.
// Expected Output:
//
// Results for date range Fri Feb 03 2017 00:00:00 GMT-0500 (EST) : Tue May 16 2017 00:00:00 GMT-0400 (EDT)
// Winner: 05/05/2017 // 23 - 26 - 33 - 35 LB 1 // Free Ticket
// Winner: 04/28/2017 // 9 - 15 - 20 - 31 LB 1 // Free Ticket
javascript:(function() {
var startDateInput= prompt("Start Date ex:(02/03/2017)","");
var endDateInput= prompt("End Date ex:(05/16/2017)","");
var dateStart = new Date(startDateInput);
var dateEnd = new Date(endDateInput);
function dateCheck(start,end,check) {
if((check <= end && check >= start)) {
return true;
}
return false;
}
console.log("Results for date range "+ dateStart.toString() +" : "+ dateEnd.toString());
$(".luckyMoneyByNumberResults > TBODY > TR").each(( index, element ) => {
var checkDate = new Date($(element).find("td:first").text());
if(dateCheck(dateStart, dateEnd, checkDate)) {
console.log("Winner: " + $(element).find("td:first").text()+ " // " + $(element).find("td:nth-child(2)").text()+ " // " + $(element).find("td:last").text());
}
})
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment