Last active
February 28, 2025 07:22
-
-
Save abhijithvijayan/1507b5d9d484cf4b7180b14154cfddb1 to your computer and use it in GitHub Desktop.
Revisions
-
abhijithvijayan revised this gist
Feb 28, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ // Login to https://fancy.parivahan.gov.in/fancy/faces/public/login.xhtml and navigate to Number Selection tab, select RTO and run these on console // Update START, END, RTO, STATE_CODE, COOKIE & SERVER_TOKEN // get the Cookie & ViewState from Network request(or with Postman Interceptor) // Find open status from here -
abhijithvijayan revised this gist
Feb 28, 2025 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ myHeaders.append("host", "fancy.parivahan.gov.in"); myHeaders.append("Cookie", COOKIE); function getNumber(result, number) { const [availableNumber] = result.match(new RegExp(`${STATE_CODE}${RTO}[A-Z]{0,2}${number}`, "g")) || [] return availableNumber; @@ -36,7 +36,7 @@ window.availableNumbers = []; const reservedOrBooked = [...document.querySelectorAll("[id*=':regigtrationNumber']")]; reservedOrBooked.forEach((reserved) => { const extractedNumber = getNumber(reserved.textContent, "[0-9]{4}"); if (extractedNumber) { window.availableNumbers.push(extractedNumber) @@ -98,7 +98,7 @@ await fetch("https://fancy.parivahan.gov.in/fancy/faces/app/applicanthome.xhtml", requestOptions) .then((response) => response.text()) .then((result) => { const extractedNumber = getNumber(result, number); if (extractedNumber && result.includes("dtAvailChoiceNumber:0:regigtrationNumber")) { console.log({ msg: "found", -
abhijithvijayan revised this gist
Feb 28, 2025 . 1 changed file with 14 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -27,10 +27,20 @@ myHeaders.append("host", "fancy.parivahan.gov.in"); myHeaders.append("Cookie", COOKIE); function getNumber(result) { const [availableNumber] = result.match(new RegExp(`${STATE_CODE}${RTO}[A-Z]{0,2}${number}`, "g")) || [] return availableNumber; } window.availableNumbers = []; const reservedOrBooked = [...document.querySelectorAll("[id*=':regigtrationNumber']")]; reservedOrBooked.forEach((reserved) => { const extractedNumber = getNumber(reserved.textContent); if (extractedNumber) { window.availableNumbers.push(extractedNumber) } }) @@ -88,14 +98,14 @@ await fetch("https://fancy.parivahan.gov.in/fancy/faces/app/applicanthome.xhtml", requestOptions) .then((response) => response.text()) .then((result) => { const extractedNumber = getNumber(result); if (extractedNumber && result.includes("dtAvailChoiceNumber:0:regigtrationNumber")) { console.log({ msg: "found", number }) window.availableNumbers.push(extractedNumber) } }) .catch((error) => console.error(error)); -
abhijithvijayan revised this gist
Feb 28, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ window.availableNumbers = []; const reservedOrBooked = [...document.querySelectorAll("[id*=':regigtrationNumber']")]; reservedOrBooked.forEach((reserved) => { window.availableNumbers.push(reserved.textContent) }) -
abhijithvijayan revised this gist
Feb 28, 2025 . 1 changed file with 96 additions and 94 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,108 +1,110 @@ // Login to https://fancy.parivahan.gov.in/fancy/faces/public/login.xhtml and navigate to Number Selection tab and run these on console // Update START, END, RTO, STATE_CODE, COOKIE & SERVER_TOKEN // get the Cookie & ViewState from Network request(or with Postman Interceptor) // Find open status from here // https://fancy.parivahan.gov.in/fancy/faces/public/seriesOpenStatus.xhtml (async () => { const START = 6198; const END = 7196; const RTO = 03; const STATE_CODE = "KL"; const COOKIE = "SERVERID_fancy_24=vahan_xxxxxxx"; const SERVER_TOKEN = "xxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/x/xxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxx+xxx/xxxx+xxxxxxxxx+x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+/xxxx/xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xx/xxxxxxx/xxxxxxxx/xxxxxxxxx+xx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xx+xxxxxxxxxx+x+xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxx+xxx/xxxx+xx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxx/x/xxxxx/xxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxx+xxxxxx/x+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxx/+xxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxx/xxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const myHeaders = new Headers(); myHeaders.append("sec-ch-ua-platform", "\"macOS\""); myHeaders.append("sec-ch-ua", "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Google Chrome\";v=\"132\""); myHeaders.append("sec-ch-ua-mobile", "?0"); myHeaders.append("Faces-Request", "partial/ajax"); myHeaders.append("X-Requested-With", "XMLHttpRequest"); myHeaders.append("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"); myHeaders.append("Accept", "application/xml, text/xml, */*; q=0.01"); myHeaders.append("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); myHeaders.append("Sec-Fetch-Site", "same-origin"); myHeaders.append("Sec-Fetch-Mode", "cors"); myHeaders.append("Sec-Fetch-Dest", "empty"); myHeaders.append("host", "fancy.parivahan.gov.in"); myHeaders.append("Cookie", COOKIE); window.availableNumbers = []; const reservedOrBooked = [...document.querySelectorAll("[id*=':regigtrationNumber']")]; reservedOrBooked.forEach((reserved) => { available.push(reserved.textContent) }) for (let number = START; number <= END; number += 1) { await new Promise((resolve) => { setTimeout(resolve, 1000) }); console.log({ msg: `checking ${number}` }) const urlencoded = new URLSearchParams(); urlencoded.append("appname1", ""); urlencoded.append("btnCheckChoiceNumber1", "btnCheckChoiceNumber1"); urlencoded.append("dtAvailChoiceNumber_scrollState", "0,0"); urlencoded.append("ib_Veh_Seri_focus", ""); urlencoded.append("ib_Veh_Seri_input", "-1"); urlencoded.append("ib_home_rto_focus", ""); urlencoded.append("ib_home_rto_input", "-1"); urlencoded.append("ib_scrossflag_focus", ""); urlencoded.append("ib_scrossflag_input", "-1"); urlencoded.append("ib_statea1_focus", ""); urlencoded.append("ib_statea1_input", "-1"); urlencoded.append("ib_statea_focus", ""); urlencoded.append("ib_statea_input", `${RTO}`); urlencoded.append("ib_stateb_focus", ""); urlencoded.append("ib_stateb_input", "-1"); urlencoded.append("ib_veh_catg_focus", ""); urlencoded.append("ib_veh_catg_input", "-1"); urlencoded.append("j_idt68", ""); urlencoded.append("javax.faces.ViewState", SERVER_TOKEN); urlencoded.append("javax.faces.partial.ajax", "true"); urlencoded.append("javax.faces.partial.execute", "@all"); urlencoded.append("javax.faces.partial.render", "tblAvailChoiceNumber popup txtChoiceNumber txtChoiceNumber1"); urlencoded.append("javax.faces.source", "btnCheckChoiceNumber1"); urlencoded.append("master_Layout_form_Login", "master_Layout_form_Login"); urlencoded.append("selCubicCapacity_focus", ""); urlencoded.append("selCubicCapacity_input", "-1"); urlencoded.append("sel_fuel_type_focus", ""); urlencoded.append("sel_fuel_type_input", "-1"); urlencoded.append("tblAvailFancyNumber:2:selected_number", "on"); urlencoded.append("tblAvailFancyNumber:j_idt116:filter", ""); urlencoded.append("tblAvailFancyNumber_scrollState", "0,67.5"); urlencoded.append("txtChoiceNumber", ""); urlencoded.append("txtChoiceNumber1", `${number}`); const requestOptions = { method: "POST", headers: myHeaders, body: urlencoded, redirect: "follow" }; await fetch("https://fancy.parivahan.gov.in/fancy/faces/app/applicanthome.xhtml", requestOptions) .then((response) => response.text()) .then((result) => { const [availableNumber] = result.match(new RegExp(`${STATE_CODE}${RTO}[A-Z]{0,2}${number}`, "g")) || [] if (number && result.includes("dtAvailChoiceNumber:0:regigtrationNumber")) { console.log({ msg: "found", number }) window.availableNumbers.push(availableNumber) } }) .catch((error) => console.error(error)); } window.availableNumbers.sort() console.log({ availableNumbers: window.availableNumbers }) })() -
abhijithvijayan revised this gist
Feb 28, 2025 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ const END = 7196; const RTO = 03; const STATE_CODE = "KL" // Login to https://fancy.parivahan.gov.in/fancy/faces/public/login.xhtml and run on the console // TODO: get the Cookie & ViewState from Network request(or with Postman Interceptor) -
abhijithvijayan created this gist
Feb 28, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,106 @@ (async () => { // Find open status from here // https://fancy.parivahan.gov.in/fancy/faces/public/seriesOpenStatus.xhtml const START = 6198; const END = 7196; const RTO = 03; const STATE_CODE = "KL" // TODO: get the Cookie & ViewState from Network request(or with Postman Interceptor) const myHeaders = new Headers(); myHeaders.append("sec-ch-ua-platform", "\"macOS\""); myHeaders.append("sec-ch-ua", "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Google Chrome\";v=\"132\""); myHeaders.append("sec-ch-ua-mobile", "?0"); myHeaders.append("Faces-Request", "partial/ajax"); myHeaders.append("X-Requested-With", "XMLHttpRequest"); myHeaders.append("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"); myHeaders.append("Accept", "application/xml, text/xml, */*; q=0.01"); myHeaders.append("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); myHeaders.append("Sec-Fetch-Site", "same-origin"); myHeaders.append("Sec-Fetch-Mode", "cors"); myHeaders.append("Sec-Fetch-Dest", "empty"); myHeaders.append("host", "fancy.parivahan.gov.in"); myHeaders.append("Cookie", "SERVERID_fancy_24=vahan_xxxxxxx"); window.availableNumbers = []; const reservedOrBooked = [...document.querySelectorAll("[id*=':regigtrationNumber']")]; reservedOrBooked.forEach((reserved) => { available.push(reserved.textContent) }) for (let number = START; number <= END; number += 1) { await new Promise((resolve) => { setTimeout(resolve, 1000) }); console.log({ msg: `checking ${number}` }) const urlencoded = new URLSearchParams(); urlencoded.append("appname1", ""); urlencoded.append("btnCheckChoiceNumber1", "btnCheckChoiceNumber1"); urlencoded.append("dtAvailChoiceNumber_scrollState", "0,0"); urlencoded.append("ib_Veh_Seri_focus", ""); urlencoded.append("ib_Veh_Seri_input", "-1"); urlencoded.append("ib_home_rto_focus", ""); urlencoded.append("ib_home_rto_input", "-1"); urlencoded.append("ib_scrossflag_focus", ""); urlencoded.append("ib_scrossflag_input", "-1"); urlencoded.append("ib_statea1_focus", ""); urlencoded.append("ib_statea1_input", "-1"); urlencoded.append("ib_statea_focus", ""); urlencoded.append("ib_statea_input", `${RTO}`); urlencoded.append("ib_stateb_focus", ""); urlencoded.append("ib_stateb_input", "-1"); urlencoded.append("ib_veh_catg_focus", ""); urlencoded.append("ib_veh_catg_input", "-1"); urlencoded.append("j_idt68", ""); urlencoded.append("javax.faces.ViewState", "xxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/x/xxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxx+xxx/xxxx+xxxxxxxxx+x/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+/xxxx/xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xx/xxxxxxx/xxxxxxxx/xxxxxxxxx+xx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xx+xxxxxxxxxx+x+xxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxx+xxx/xxxx+xx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxx/x/xxxxx/xxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxx+xxxxxx/x+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxx/+xxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxx/xxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); urlencoded.append("javax.faces.partial.ajax", "true"); urlencoded.append("javax.faces.partial.execute", "@all"); urlencoded.append("javax.faces.partial.render", "tblAvailChoiceNumber popup txtChoiceNumber txtChoiceNumber1"); urlencoded.append("javax.faces.source", "btnCheckChoiceNumber1"); urlencoded.append("master_Layout_form_Login", "master_Layout_form_Login"); urlencoded.append("selCubicCapacity_focus", ""); urlencoded.append("selCubicCapacity_input", "-1"); urlencoded.append("sel_fuel_type_focus", ""); urlencoded.append("sel_fuel_type_input", "-1"); urlencoded.append("tblAvailFancyNumber:2:selected_number", "on"); urlencoded.append("tblAvailFancyNumber:j_idt116:filter", ""); urlencoded.append("tblAvailFancyNumber_scrollState", "0,67.5"); urlencoded.append("txtChoiceNumber", ""); urlencoded.append("txtChoiceNumber1", `${number}`); const requestOptions = { method: "POST", headers: myHeaders, body: urlencoded, redirect: "follow" }; await fetch("https://fancy.parivahan.gov.in/fancy/faces/app/applicanthome.xhtml", requestOptions) .then((response) => response.text()) .then((result) => { const [availableNumber] = result.match(new RegExp(`${STATE_CODE}${RTO}[A-Z]{0,2}${number}`, "g")) || [] if (number && result.includes("dtAvailChoiceNumber:0:regigtrationNumber")) { console.log({ msg: "found", number }) window.availableNumbers.push(availableNumber) } }) .catch((error) => console.error(error)); } window.availableNumbers.sort() console.log({ availableNumbers: window.availableNumbers }) })()