Last active
May 1, 2024 20:56
-
-
Save molavec/3cdd90e008d1fb63c4130d00f9ea2a21 to your computer and use it in GitHub Desktop.
dgec-parse-link.js
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
// Ejemplo para testear la decoficación de un enlace | |
const url = require('url'); | |
// Cambiar Según sea conveniente | |
const link = | |
'https://usm-pec-desa.powerappsportals.com/?%20%20%20%20id=MQ==%20%20%20%20&internalId=Mg==%20%20%20%20&bannerCode=YmFubmVyX2NvZGU=%20%20%20%20&version=MQ==%20%20%20%20&initDate=MDEtMDMtMjAyNA==%20%20%20%20&endDate=MDEtMDMtMjAyNA==%20%20%20%20&modules=MS1Nb2R1bG8gSTogTHVnYXIgZGUgVHJhYmFqbywyLU1vZHVsbyBJSTogRmFjdG9yZXMgQW1iaWVudGFsZXMsMy1Nb2R1bG8gSUlJOiBDb250cm9sIGRlIEluZ2VuaWVyw61h%20%20%20%20&name=RGlwbG9tYSBlbiBIaWdpZW5lIE9jdXBhY2lvbmFsIENvbmNlcGNpw7Nu%20%20%20%20&description=RWwgRGlwbG9tYSBlbiBIaWdpZW5lIE9jdXBhY2lvbmFsIGVzIHVuIHByb2dyYW1hIGRpc2XDsWFkbyBwYXJhIHByb3BvcmNpb25hciBsYXMgaGFiaWxpZGFkZXMgbmVjZXNhcmlhcyBhIGxvcyBwcm9mZXNpb25hbGVzIHF1ZSBkZXNlZW4gZXZhbHVhciBhbWJpZW50ZQ==%20%20%20%20&price=MjEwMDAwMA==%20%20%20%20&pricePaid=MjEwMDAwMA=='; | |
const current_url = new URL(link); | |
// get access to URLSearchParams object | |
const search_params = current_url.searchParams; | |
console.log(search_params); | |
for (const [key, value] of search_params.entries()) { | |
console.log(`${key}, ${new Buffer.from(value, 'base64').toString('utf-8')}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment