Skip to content

Instantly share code, notes, and snippets.

@jayremnt
Created September 11, 2020 17:42
Show Gist options
  • Save jayremnt/ed3f756654b9863a730b55b7f1aa187d to your computer and use it in GitHub Desktop.
Save jayremnt/ed3f756654b9863a730b55b7f1aa187d to your computer and use it in GitHub Desktop.
fdsfds
getFriendRequestsSentIds(cursor = "") {
return new Promise((resolve, reject) => {
this.core.request("POST", "https://www.facebook.com/api/graphql/", {
fb_dtsg: this.core.user.fbDtsg,
fb_api_caller_class: "RelayModern",
fb_api_req_friendly_name: "FriendingCometOutgoingRequestsDialogQuery",
variables: {
"count": 10,
"scale": 1.5,
"cursor": cursor
},
doc_id: "4197414966995373"
})
.then(response => {
try {
let listIds = [];
response = JSON.parse(response);
response.data.viewer.outgoing_friend_requests_connection.edges.forEach(edge => {
listIds.push(edge.node.id);
});
resolve({
pageInfo: response.data.viewer.outgoing_friend_requests_connection.page_info,
listIds: listIds
});
}
catch(err) {
console.error(err);
reject(err);
}
})
.catch(reject);
});
}
cancelFriendRequestsSent(friendId) {
return new Promise((resolve, reject) => {
this.core.request("POST", "http://www.facebook.com/api/graphql/", {
fb_dtsg: this.core.user.fbDtsg,
fb_api_caller_class: "RelayModern",
fb_api_req_friendly_name: "FriendingCometFriendRequestCancelMutation",
variables: {
"input": {
"cancelled_friend_requestee_id": friendId,
"source": "manage_outgoing_requests",
"actor_id": this.core.user.id,
"client_mutation_id": "5"
},
"scale":1.5
},
doc_id: "3226051994092510"
})
.then(resolve("ok"))
.catch(reject);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment