Last active
June 8, 2022 14:17
-
-
Save bokenator/4ceb8b41d05debb318f3a649ac13b7ab to your computer and use it in GitHub Desktop.
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
/* | |
To use this script, do the following: | |
1. log in to https://ais.usvisa-info.com | |
2. Click on the "Continue" button to go to the actions page | |
3. Open up Console on your browser | |
4. Copy and paste this script into the console and press Enter to run the script | |
*/ | |
'use strict'; | |
// Enter the desired date (or earlier) in yyyy-mm-dd format | |
var desiredDate = new Date('2017-11-01'); | |
var path = window.location.pathname, | |
id = path.split('/')[4]; | |
var scrapeInterval = setInterval(function () { | |
$.getJSON('https://ais.usvisa-info.com/en-ca/niv/schedule/' + id + '/appointment/days/94.json?appointments[expedite]=false', function (data) { | |
var earliestDate = new Date(data[0].date); | |
if (earliestDate.getTime() <= desiredDate.getTime()) { | |
window.alert('Earliest date available: ' + earliestDate.toDateString()); | |
} else { | |
console.log('Not available'); | |
} | |
}); | |
}, 10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error message