Jak poprawić ten kod ponieważ po wyświetleniu wiadomości na facebooku już jej nie wyświetla
chodzi mi o to żeby po odczytaniu wiadomości dalej była widoczna w tym programie
import os,time,sys
from facepy import GraphAPI
from facepy import exceptions
#Facebook app id and secret from https://developers.facebook.com/tools/explorer
LONG_LIVE_ACCESS_TOKEN = 'token' #kod token z facebooka
APP_ID = 'xxxxx'
SECRET_KEY = 'yyyyy'
def get_message_body(message_list):
""" Function to get the message or message body."""
return message_list['snippet']
def pretty_print(message_list):
""" Function which prints the o/p in a specified format."""
for message in message_list:
fblog=get_message_body(message)
print fblog
graph = GraphAPI(LONG_LIVE_ACCESS_TOKEN)
try:
json_output = graph.fql(
"SELECT snippet, snippet_author, recipients FROM thread WHERE folder_id = 0 and unread != 0")
except exceptions.OAuthError as e:
print e.message
sys.exit(0)
message_list = json_output['data']
pretty_print(message_list)