Commit e52b36a1 authored by insert's avatar insert 🎺

Add profile picture scraping

parent 1f5a1271
// ==UserScript==
// @name Google Contacts Scraper
// @namespace https://insrt.uk
// @version 1.0
// @version 1.1
// @description scrapes contacts from a given page
// @author insert
// @match https://contacts.google.com/*
......@@ -23,6 +23,7 @@
let set = {};
let pfp = {};
document.onreadystatechange = function () {
if (document.readyState === "complete") {
......@@ -45,6 +46,9 @@ document.onreadystatechange = function () {
if (p.startsWith('\t')) p = p.substring(1);
let r = p.split('\t');
set[r[0]] = r[1];
let l = document.querySelector('.XXcuqd').childNodes[0].childNodes[0].childNodes[1].src;
if (l.startsWith('https://lh3.googleusercontent.com/a-'))
pfp[r[1]] = l;
}
});
break;
......@@ -66,11 +70,22 @@ document.onreadystatechange = function () {
data: set
});
}
function cpfp() {
let d = new Date();
return JSON.stringify({
_comment: "PFP URLs",
year: d.getMonth() > 7,
generated: '' + d,
data: pfp
});
}
(() => {
let el = document.createElement('a');
el.innerText = "click to export and console.log data set";
el.innerText = "click to export name and email combos and console.log data set";
el.style.display = 'block';
el.addEventListener('click', () => {
console.log(collect());
return false;
......@@ -78,5 +93,17 @@ document.onreadystatechange = function () {
document.querySelector('.gb_ne').append(el);
})();
(() => {
let el = document.createElement('a');
el.innerText = "click to export profile picture urls and console.log data set";
el.addEventListener('click', () => {
console.log(cpfp());
return false;
});
document.querySelector('.gb_ne').append(el);
})();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment