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); |
Author
bokenator
commented
Dec 12, 2021
via email
Not sure, haven't tried in a while lol. Let me know if you need any help
getting it to work.
…On Sun, Dec 12, 2021, 2:24 PM Nemeziz ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
still works?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/4ceb8b41d05debb318f3a649ac13b7ab#gistcomment-3992744>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4KMENSBGIR4KPDHNWGK6TUQTZHLANCNFSM5J4SZKRA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
Error message
VM60:11 Uncaught TypeError: Cannot read properties of undefined (reading 'date')
at Object.success (<anonymous>:11:39)
at i (application-a5d81146f0dbde092ba8335f14cb72458e9108c3ecbf8e570acf6ed419b76545.js:3:27449)
at Object.fireWith [as resolveWith] (application-a5d81146f0dbde092ba8335f14cb72458e9108c3ecbf8e570acf6ed419b76545.js:3:28213)
at y (application-a5d81146f0dbde092ba8335f14cb72458e9108c3ecbf8e570acf6ed419b76545.js:5:22721)
at XMLHttpRequest.c (application-a5d81146f0dbde092ba8335f14cb72458e9108c3ecbf8e570acf6ed419b76545.js:5:26925)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment