This file contains 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
page_id = '102927594431953' | |
page_token = None | |
for item in pages_data['data']: | |
if item['id'] == page_id': | |
page_token = item['access_token'] | |
print(page_token) | |
""" | |
OUTPUT PARAGRAFO[4]: |
This file contains 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
#!/usr/bin/env python3.4 | |
# -*- coding: utf-8 -*- | |
""" | |
Request Token long termn | |
""" | |
import requests | |
def get_token(access_token_url): |
This file contains 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
graph = facebook.GraphAPI(access_token=page_token, version="3.1") | |
print(graph.get_object(id=page_id, fields='about, category')) | |
""" | |
OUTPUT PARAGRAFO [5] | |
{'about': 'Michelone', 'category': 'Blogger', 'id': '102927594431953'} | |
""" |
This file contains 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
import facebook | |
user_long_token = 'EAAHR3c1UymABABifeBxaSxYBQZBLaEqOFZBAnXlHrF9aYOJZAbs4QBZBcULQTC2uNwPylWf2pZBoZBoZAio0AgBQfG8YRd3hYMUIWnrHf4IoZA5ZAlgYqoVbZA27ucCXzeZCfTeNiwYecM48xXkKgHViJkAqorHeYZByhd7aUQQPP9NqzAZDZD' | |
graph = facebook.GraphAPI(access_token=user_long_token, version="3.1") | |
pages_data = graph.get_object("/me/accounts") | |
print(pages_data) | |
""" |
This file contains 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
#!/usr/bin/env python3.4 | |
# -*- coding: utf-8 -*- | |
""" | |
Request Token long termn | |
""" | |
__author__ = "Michele Berardi" | |
__copyright__ = "Copyright 2018, " | |
__license__ = "GPL" |
This file contains 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
import os | |
from datetime import datetime | |
import redis | |
import logging | |
import time | |
from http.client import HTTPConnection, socket | |
""" | |
ciao |
NewerOlder