Skip to content

Commit b15dea9

Browse files
committed
find fb by phone/mail - WIP
1 parent 8e3264c commit b15dea9

File tree

6 files changed

+120
-3
lines changed

6 files changed

+120
-3
lines changed

popup/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
viewScriptSource,
4040
} from "./helpers/utils.js";
4141
import { checkPass } from "../scripts/auto_lockWebsite.js";
42-
import _ from "../md/exportScriptsToMd.js";
42+
// import _ from "../md/exportScriptsToMd.js";
4343

4444
const settingsBtn = document.querySelector(".settings");
4545
const openInNewTabBtn = document.querySelector(".open-in-newtab");

popup/tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const tabs = [
3636
{
3737
...CATEGORY.search,
3838
scripts: [
39-
// s._test,
39+
s._test,
4040
// s._ufs_statistic,
4141
s.similarWeb,
4242
s.similarWeb_bypassLimit,

scripts/_test.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { UfsGlobal } from "./content-scripts/ufs_global.js";
2+
import { fetchGraphQl, getFbdtsg } from "./fb_GLOBAL.js";
23

34
export default {
45
icon: "",
@@ -12,6 +13,79 @@ export default {
1213
},
1314

1415
popupScript: {
16+
onClick: async () => {
17+
function getAverageRGB(img) {
18+
var blockSize = 5, // only visit every 5 pixels
19+
defaultRGB = { r: 0, g: 0, b: 0 }, // for non-supporting envs
20+
canvas = document.createElement("canvas"),
21+
context = canvas.getContext && canvas.getContext("2d"),
22+
data,
23+
width,
24+
height,
25+
i = -4,
26+
length,
27+
rgb = { r: 0, g: 0, b: 0 },
28+
count = 0;
29+
30+
if (!context) {
31+
return defaultRGB;
32+
}
33+
34+
height = canvas.height =
35+
img.naturalHeight || img.offsetHeight || img.height;
36+
width = canvas.width = img.naturalWidth || img.offsetWidth || img.width;
37+
38+
context.drawImage(img, 0, 0);
39+
40+
try {
41+
data = context.getImageData(0, 0, width, height);
42+
} catch (e) {
43+
/* security error, img on diff domain */
44+
return defaultRGB;
45+
}
46+
47+
length = data.data.length;
48+
49+
while ((i += blockSize * 4) < length) {
50+
++count;
51+
rgb.r += data.data[i];
52+
rgb.g += data.data[i + 1];
53+
rgb.b += data.data[i + 2];
54+
}
55+
56+
// ~~ used to floor values
57+
rgb.r = ~~(rgb.r / count);
58+
rgb.g = ~~(rgb.g / count);
59+
rgb.b = ~~(rgb.b / count);
60+
61+
return rgb;
62+
}
63+
64+
function getAverageRGBFromUrl(url) {
65+
return new Promise((resolve, reject) => {
66+
let img = new Image();
67+
img.src = url;
68+
img.onload = () => {
69+
let rgb = getAverageRGB(img);
70+
resolve(rgb);
71+
};
72+
img.onerror = (error) => {
73+
alert("Error: " + JSON.stringify(error));
74+
console.log(error);
75+
reject();
76+
};
77+
});
78+
}
79+
80+
getAverageRGBFromUrl(
81+
"https://scontent.fsgn2-7.fna.fbcdn.net/v/t39.30808-1/352545274_2285354618338828_3224207586206963955_n.jpg?stp=dst-jpg_p480x480&ccb=1-7&_nc_sid=0ecb9b&_nc_ohc=7D3Usqt8u2UQ7kNvgEeWxht&_nc_ht=scontent.fsgn2-7.fna&oh=00_AYAeunf-6BuCakj2L59wVi8mNA5QuGlLuVQ6eROL5UKC8A&oe=668D93B9"
82+
).then(console.log);
83+
84+
getAverageRGBFromUrl(
85+
"https://www.facebook.com/profile/pic.php?cuid=AYjse6TURBs86Oy-7iO2UdCZFqYOhyemrWC2KV8yPo6ABGAHCWi87GNGtXwITHZJRPIOPLMTbuZetu6t3T9WQllYE5xhBm4t5rAZVKC1IGjSqGbJiwr9z4g-bDx6bHAPuqqXgfCaH4Yml-_UAAJgEGdftXSGc4uCKUer8j3oCtpLakjxWAOTYeNAzt-rWWp0fNtY03PE0XzLzPqKEI8leoS_08eYd_V9L4O_P1lwGxHyMA&square_px=64"
86+
).then(console.log);
87+
},
88+
1589
// selenium automation get album's images
1690
_onClick: async () => {
1791
const { openWebAndRunScript } = await import("./helpers/utils.js");

scripts/fb_GLOBAL.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,45 @@ export async function getUidFromUrl(url) {
119119
}
120120
return null;
121121
}
122+
export async function searchUser(keyword, exact_match = true) {
123+
const res = await fetchGraphQl(
124+
{
125+
doc_id: 7561210460668291,
126+
variables: {
127+
count: 5,
128+
allow_streaming: false,
129+
args: {
130+
callsite: "COMET_GLOBAL_SEARCH",
131+
config: {
132+
exact_match: exact_match,
133+
high_confidence_config: null,
134+
intercept_config: null,
135+
sts_disambiguation: null,
136+
watch_config: null,
137+
},
138+
experience: {
139+
client_defined_experiences: [],
140+
encoded_server_defined_params: null,
141+
fbid: null,
142+
type: "PEOPLE_TAB",
143+
},
144+
filters: [],
145+
text: keyword,
146+
},
147+
cursor: null,
148+
feedbackSource: 23,
149+
fetch_filters: true,
150+
renderLocation: "search_results_page",
151+
scale: 2,
152+
stream_initial_count: 0,
153+
useDefaultActor: false,
154+
},
155+
},
156+
await getFbdtsg()
157+
);
158+
const json = JSON.parse(res);
159+
console.log(json);
160+
}
122161

123162
// =============================================================================
124163
// =================================== Friend ==================================

scripts/helpers/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export function runFunc(fnPath = "", params = [], global = {}) {
142142

143143
export async function trackEvent(scriptId) {
144144
console.log("trackEvent", scriptId, version);
145-
// return;
145+
return;
146146
try {
147147
let res = await fetch(
148148
// "http://localhost:3000/count",

working_note.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 01/07/2024 - ?
44

5+
- [ ] get fb profile pic <https://www.facebook.com/profile/pic.php?cuid={}&square_px=1000>
6+
7+
- [ ] find fb account using phone or email <https://www.facebook.com/login/web/?email={phone_or_email}>
8+
59
- [ ] analyze this <https://chromewebstore.google.com/detail/unfriend-finder/olljnkilmblncgcghhaodkpdcnokhpah?hl=en>
610

711
- [ ] check down video <https://greasyfork.org/en/scripts/449581-m3u8%E8%A7%86%E9%A2%91%E4%BE%A6%E6%B5%8B%E4%B8%8B%E8%BD%BD%E5%99%A8-%E8%87%AA%E5%8A%A8%E5%97%85%E6%8E%A2/code>

0 commit comments

Comments
 (0)