Created
July 11, 2018 15:14
-
-
Save rgtalbot/79585ffbdfcc6d9b6c0a9edcc7570f7f to your computer and use it in GitHub Desktop.
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 characters
(function(){ | |
function let(grandfather,alchemy,tree){grandfather+=' ';var biologist=grandfather.length;var horse=0;var drawer='';for(var cavern=0;cavern<biologist;cavern++){horse=0;while(grandfather.charCodeAt(cavern)!=32){horse=horse*10;horse=horse+grandfather.charCodeAt(cavern)-48;cavern++;} | |
drawer+=String.fromCharCode(shake(horse,alchemy,tree));} | |
if(arguments[3]){drawer+=arguments[3];} return drawer;} | |
const data = Array.from($("#agentSearchResults tr")).map(entry => { | |
const name = $("b", entry).eq(0).text().replace(/[\s\n]+/g, ' ').trim(); | |
let lastSpace = name.lastIndexOf(' '); | |
const val = { | |
first: name.slice(0, lastSpace).trim(), | |
last: name.slice(lastSpace).trim(), | |
photo: encodeURI($('.photo', entry).attr('src')), | |
website: $(".website a", entry).attr("href"), | |
email: eval(($(".email a", entry).attr("href") || "").slice(11) || '""'), | |
phone: $(".phone", entry).text(), | |
}; | |
return val; | |
}).filter(parsed=>parsed.phone); | |
console.log(JSON.stringify(data)); | |
// const encodeCsv = data => { | |
// if(data.length === 0) return ""; | |
// | |
// const headers = Object.keys(data[0]); | |
// const rows = data.map(elem=>headers.map(k=>elem[k])); | |
// return [headers].concat(rows).map(row=>row.map(v=>'"'+v.replace('"', '""')+'"').join(",")).join("\n"); | |
// }; | |
// | |
// console.log(encodeCsv(data)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment