[~] Refactor
This commit is contained in:
parent
3b2dd8045e
commit
331e11d728
34
deps/greasyfork/linkedin.user.js
vendored
34
deps/greasyfork/linkedin.user.js
vendored
@ -2,7 +2,13 @@
|
||||
// @name data extraction linkedin
|
||||
// @namespace Violentmonkey Scripts
|
||||
// @match https://www.linkedin.com/*
|
||||
// @grant none
|
||||
// @grant GM_getValue
|
||||
// @grant GM_setValue
|
||||
// @grant GM_getValues
|
||||
// @grant GM_setValues
|
||||
// @grant GM_listValues
|
||||
// @grant GM_deleteValue
|
||||
// @grant GM_deleteValues
|
||||
// @version 0.1
|
||||
// @author Siarhei Siniak
|
||||
// @license Unlicense
|
||||
@ -15,6 +21,10 @@
|
||||
// ==/UserScript==
|
||||
|
||||
class Linkedin {
|
||||
constructor() {
|
||||
this.data = new Map();
|
||||
}
|
||||
|
||||
parse_header() {
|
||||
return [
|
||||
$(
|
||||
@ -26,11 +36,31 @@ class Linkedin {
|
||||
]
|
||||
}
|
||||
|
||||
data_add (text) {
|
||||
if (self.data.has(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self.data.set(text, {
|
||||
value: text,
|
||||
ts: (new Date()).valueOf(),
|
||||
});
|
||||
|
||||
console.log(self.data[text]);
|
||||
}
|
||||
|
||||
document_on_changed () {
|
||||
let self = this;
|
||||
let current_data = self.parse_header();
|
||||
|
||||
console.log(current_data);
|
||||
current_data[0].forEach((i, o) => {
|
||||
self.data_add(o);
|
||||
});
|
||||
|
||||
current_data[1].forEach((i, o) => {
|
||||
self.data_add(o);
|
||||
});
|
||||
}
|
||||
|
||||
listener_add() {
|
||||
|
Loading…
Reference in New Issue
Block a user