You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in facebook/init.py line 218 (fql methods) insert this:
'multiquery': [('queries', json, []),],
then try this:
fbc = Facebook("your_api_key", "")
# assign session_key and secret_key
data = fbc.fql.multiquery({"query1":"select post_id, actor_id, target_id, message from stream where filter_key in (select filter_key from stream_filter where uid={your_uid} AND type='newsfeed')", "query2":"select name from user where uid in (select actor_id from #query1)",})
import json
import requests
class Facebook:
def __init__(self, api_key, session_key):
self.api_key = api_key
self.session_key = session_key
self.secret_key = ""
def fql_multiquery(self, queries):
url = "https://api.facebook.com/method/fql.multiquery"
params = {
"queries": json.dumps(queries),
"format": "json",
"api_key": self.api_key,
"session_key": self.session_key,
"sig": self.generate_signature()
}
response = requests.get(url, params=params)
data = response.json()
return data
def generate_signature(self):
# Function to generate signature, implement as needed
pass
# Usage example
fbc = Facebook("your_api_key", "your_session_key")
# Assign session_key and secret_key as needed
data = fbc.fql_multiquery({
"query1": "select post_id, actor_id, target_id, message from stream where filter_key in (select filter_key from stream_filter where uid={your_uid} AND type='newsfeed')",
"query2": "select name from user where uid in (select actor_id from #query1)"
})
print(data)
in facebook/init.py line 218 (fql methods) insert this:
'multiquery': [('queries', json, []),],
then try this:
fbc = Facebook("your_api_key", "")
# assign session_key and secret_key
data = fbc.fql.multiquery({"query1":"select post_id, actor_id, target_id, message from stream where filter_key in (select filter_key from stream_filter where uid={your_uid} AND type='newsfeed')", "query2":"select name from user where uid in (select actor_id from #query1)",})
http://wiki.developers.facebook.com/index.php/Fql.multiquery
The text was updated successfully, but these errors were encountered: