@@ -11,7 +11,10 @@ from .utils import *
|
||||
from .models import *
|
||||
from .graphql import *
|
||||
import time
|
||||
|
||||
try:
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
except ImportError:
|
||||
from urlparse import urlparse, parse_qs
|
||||
|
||||
|
||||
class Client(object):
|
||||
@@ -1313,6 +1316,25 @@ class Client(object):
|
||||
r = self._post(self.req_url.CONNECT, data)
|
||||
return r.ok
|
||||
|
||||
def removeFriend(self, friend_id=None):
|
||||
"""Removes a specifed friend from your friend list
|
||||
|
||||
:param friend_id: The id of the friend that you want to remove
|
||||
:return: Returns error if the removing was unsuccessful, returns True when successful.
|
||||
"""
|
||||
payload = {
|
||||
"friend_id": friend_id,
|
||||
"unref": "none",
|
||||
"confirm": "Confirm",
|
||||
}
|
||||
r = self._post(self.req_url.REMOVE_FRIEND, payload)
|
||||
query = parse_qs(urlparse(r.url).query)
|
||||
if "err" not in query:
|
||||
log.debug("Remove was successful!")
|
||||
return True
|
||||
else:
|
||||
log.warning("Error while removing friend")
|
||||
return False
|
||||
|
||||
"""
|
||||
LISTEN METHODS
|
||||
|
@@ -122,7 +122,8 @@ class ReqUrl(object):
|
||||
ATTACHMENT_PHOTO = "https://www.facebook.com/mercury/attachments/photo/"
|
||||
EVENT_REMINDER = "https://www.facebook.com/ajax/eventreminder/create"
|
||||
MODERN_SETTINGS_MENU = "https://www.facebook.com/bluebar/modern_settings_menu/"
|
||||
|
||||
REMOVE_FRIEND = "https://m.facebook.com/a/removefriend.php"
|
||||
|
||||
pull_channel = 0
|
||||
|
||||
def change_pull_channel(self, channel=None):
|
||||
|
Reference in New Issue
Block a user