put notes/5ebdb593-8081-4300-9293-bcd73592919b.json
Browse files
notes/5ebdb593-8081-4300-9293-bcd73592919b.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"id": "5ebdb593-8081-4300-9293-bcd73592919b",
|
3 |
+
"title": "info.js",
|
4 |
+
"content": "const fs = require('fs');\nconst axios = require('axios');\n\nmodule.exports = {\n config: {\n name: \"info\",\n version: \"5.0.0\",\n description: \"Lấy full info Facebook từ cookie Chrome, bao gồm avatar, cover, posts, family, likes, work, education\",\n commandCategory: \"Tiện ích\",\n usages: \"[uid/link/@tag]\",\n hasPermssion: 0,\n },\n\n async run({ api, event, args }) {\n try {\n api.sendMessage('🔄 Đang lấy thông tin...', event.threadID, event.messageID);\n\n // 1️⃣ Load cookie từ appstate.json\n const cookiesJSON = JSON.parse(fs.readFileSync('appstate.json', 'utf8'));\n const cookieHeader = cookiesJSON.map(c => `${c.key}=${c.value}`).join('; ');\n\n // 2️⃣ UID\n const id = args[0] || event.senderID;\n\n // 3️⃣ Info cơ bản\n const baseFields = 'id,name,username,gender,birthday,link,about,website';\n const infoResp = await axios.get(`https://graph.facebook.com/${id}?fields=${baseFields}`, {\n headers: { cookie: cookieHeader }\n });\n const info = infoResp.data;\n\n // 4️⃣ Avatar + cover\n const avatarUrl = `https://graph.facebook.com/${id}/picture?width=1500&height=1500`;\n const coverUrl = info.cover?.source || null;\n const attachments = [];\n if (coverUrl) attachments.push((await axios.get(coverUrl, { responseType: 'stream' })).data);\n attachments.push((await axios.get(avatarUrl, { responseType: 'stream' })).data);\n\n // 5️⃣ Family\n let family = 'Không có';\n try {\n const famResp = await axios.get(`https://graph.facebook.com/${id}?fields=family`, { headers: { cookie: cookieHeader } });\n if (famResp.data.family) family = famResp.data.family.data.map(f => `${f.name} (${f.relationship})`).join('\\n');\n } catch {}\n\n // 6️⃣ Posts (5 posts gần nhất)\n let posts = 'Không có bài đăng';\n try {\n const postsResp = await axios.get(`https://graph.facebook.com/${id}?fields=posts.limit(5){created_time,message,actions}`, { headers: { cookie: cookieHeader } });\n if (postsResp.data.posts?.data) {\n posts = postsResp.data.posts.data.map((p, i) => {\n const link = p.actions?.[0]?.link?.replace('https://www.facebook.com','https://FB.com') || '❎';\n return `${i+1}. ${p.message || 'Không có nội dung'}\\n ⏰ ${p.created_time}\\n 🔗 Link: ${link}`;\n }).join('\\n\\n');\n }\n } catch {}\n\n // 7️⃣ Likes (5 likes)\n let likes = 'Không có';\n try {\n const likesResp = await axios.get(`https://graph.facebook.com/${id}?fields=likes.limit(5){name,category,id}`, { headers: { cookie: cookieHeader } });\n if (likesResp.data.likes?.data) {\n likes = likesResp.data.likes.data.map((l, i) => `${i+1}. ${l.name} (${l.category})\\n 🔗 Link: FB.com/${l.id}`).join('\\n');\n }\n } catch {}\n\n // 8️⃣ Work\n let work = 'Không có';\n try {\n const workResp = await axios.get(`https://graph.facebook.com/${id}?fields=work`, { headers: { cookie: cookieHeader } });\n if (workResp.data.work) work = workResp.data.work.map(w => `${w.employer?.name || '❎'}\\n ➛ Link: FB.com/${w.id || ''}`).join('\\n');\n } catch {}\n\n // 9️⃣ Education\n let education = 'Không có';\n try {\n const eduResp = await axios.get(`https://graph.facebook.com/${id}?fields=education`, { headers: { cookie: cookieHeader } });\n if (eduResp.data.education) education = eduResp.data.education.map(e => `${e.school?.name || '❎'} (${e.type || '❎'})`).join('\\n');\n } catch {}\n\n // 10️⃣ Message tổng hợp\n const message = `\n╭────────────⭓\n│ Tên: ${info.name}\n│ Biệt danh: ${info.username || '❎'}\n│ FB: ${info.link || '❎'}\n│ Giới tính: ${info.gender || '❎'}\n│ Sinh nhật: ${info.birthday || '❎'}\n│ Giới thiệu: ${info.about || 'Không có'}\n│ Website: ${info.website || 'Không có'}\n├────────────⭔\n│ Family: \n${family}\n├────────────⭔\n│ 5 Posts gần nhất:\n${posts}\n├────────────⭔\n│ Likes (5):\n${likes}\n├────────────⭔\n│ Work: \n${work}\n├────────────⭔\n│ Education:\n${education}\n╰────────────⭓`;\n\n api.sendMessage({ body: message, attachment: attachments }, event.threadID, event.messageID);\n\n } catch (err) {\n api.sendMessage(`❌ Lỗi: ${err.message}`, event.threadID, event.messageID);\n }\n }\n};\n",
|
5 |
+
"language": "javascript",
|
6 |
+
"createdAt": 1757062902019,
|
7 |
+
"updatedAt": 1757062902019
|
8 |
+
}
|