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
<?php | |
/** | |
* GET FBID FROM LINK USERNAME | |
* Author : fb.com/trojan.nguyen.103 | |
* Blog : https://jack098.blogspot.com | |
*/ | |
header("Access-Control-Allow-Origin: *"); //bắt buộc - thông số để get được Json cho APP - tham khảo : https://goo.gl/ox3gf3 | |
class getFbid | |
{ |
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 kickmem(info){ | |
var link = JSON.parse(JSON.stringify(info)); | |
fetch("LINK CỦA BẠN/?link=" + link.linkUrl).then(function(res){ | |
return res.json() | |
}).then(function(ress){ | |
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { | |
chrome.tabs.sendMessage(tabs[0].id, {jack: 'KickMember', idUser: ress.fbid}, function(res) { //giao tiếp giữa 2 môi trường Extension của Chrome | |
if(res.kicked == 1){ //Nếu kick thành công - hiện thông báo | |
chrome.tabs.sendMessage(tabs[0].id, {jack: 'AlertKickSuccess'}); | |
}else{ // Kick không thành công - hiện thông báo gì đó |
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
chrome.runtime.onMessage.addListener(function(req, sender, sendRes) { | |
if(req.jack == 'KickMember'){ | |
var checkKick = KickMember(IDGr, req.idUser, fb_dtsg); | |
sendRes({kicked: checkKick ?1:0}); | |
} | |
if(req.jack == 'AlertKickSuccess'){ | |
AlertKickSuccess(); | |
} | |
if(req.jack == 'AlertKickFailure'){ | |
AlertKickFailure(); |
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 KickMember(idgroup, idUser, fb_dtsg) { | |
var Optional = { | |
method: "POST", | |
credentials: "include", | |
mode: 'cors', | |
headers:{ | |
'Access-Control-Allow-Origin':'*' | |
}, | |
headers: { | |
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8" |
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
/* | |
* Get Token Full Permission IOS - jack098.blogspot.com | |
*/ | |
var userId = $.cookie("c_user"); | |
var dtsg = $("input[name='fb_dtsg']").val(); | |
var Handle = returnToken(dtsg, userId).then(function(data){ // Vì đây là thuộc tính Promise, nên phải dùng hàm .then để gọi Value ra | |
var token = data.match(/access_token=(.*)(?=&expires_in)/)[1]; // Đây là Token của chúng ta | |
console.log(token); | |
}) ? true : false; |
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
/* | |
* Check Commented Function - jack098.blogspot.com | |
*/ | |
var checkCmt = checkCommented(token, ID_USER, ID_PAGE, ID_POST); | |
checkCmt.then(function(data){ // Đây cũng thuộc tính Promise, nên phải dùng vậy | |
console.log((jQuery.isEmptyObject(data["data"])) ? false : true); | |
}); | |
function checkCommented(access_token, uid, page_id, post_id) { |
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
/* | |
* Check Liked Function - jack098.blogspot.com | |
*/ | |
var checkLike = checkLiked(token, ID_USER, ID_PAGE, ID_POST); | |
checkLike.then(function(data){ | |
console.log((jQuery.isEmptyObject(data["data"])) ? false : true); | |
}) | |
function checkLiked(access_token, uid, page_id, post_id) { |
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
var userId = $.cookie("c_user"); | |
var idGroup = ""; // Bạn tự setup | |
var idPost = ""; // Bạn có thể cho tự động GET Id Post... | |
var dtsg = $("input[name='fb_dtsg']").val(); | |
var Handle = returnToken(dtsg, userId).then(function(data){ // Vì đây là thuộc tính Promise, nên phải dùng hàm .then để gọi Value ra | |
var token = data.match(/access_token=(.*)(?=&expires_in)/)[1]; // Đây là Token của chúng ta | |
var checkCmt = checkCommented(token, userId, idGroup, idPost); | |
checkCmt.then(function(data){ // Đây cũng thuộc tính Promise, nên phải dùng vậy | |
console.log((jQuery.isEmptyObject(data["data"])) ? false : true); // check xem bạn có comment hay chưa? | |
}); |
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
* : nhân | |
+ : cộng | |
- : trừ | |
/ : chia | |
^ : mũ. Vd : 2^3 => 8 | |
(): đóng ngoặc, mở ngoặc | |
Abs : trị | |
Ceiling : Làm tròn số lên. Vd : 0.2 => 1 | |
Floor : Làm tròn số xuống. Vd : 0.8 => 0 | |
Mod : Lấy số dư. Vd : Mod(8, 4) => 0. Mod(9,2) => 1 |
OlderNewer