Created
December 28, 2018 14:31
-
-
Save ErlendEllingsen/74b5470a97e70e724b13908f1f4f0324 to your computer and use it in GitHub Desktop.
Decode email links
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
const fs = require('fs'); | |
const he = require('he'); | |
const raw = fs.readFileSync('input.txt').toString(); | |
// Construct a downloadable link from the email contents | |
const lines = raw.split('=\r\n'); | |
const data = lines.join(''); | |
let link = data.split('<li>Link: ')[1].split('</li>')[0]; | |
link = link.replace(/=3D/g, '='); | |
link = he.decode(link); | |
console.log('link', link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment