# -*- coding: utf-8 -*-
import os
import fbconsole
here = os.path.dirname(os.path.abspath(__file__))
def fbfeed():
fbconsole.APP_ID = '588914247790498'
fbconsole.AUTH_SCOPE = ['publish_stream', 'publish_checkins', 'read_stream', 'offline_access']
fbconsole.authenticate()
newsfeed = fbconsole.get('/me/home')
newsfeedData = newsfeed["data"]
for status in newsfeedData:
fromn = [status['from']['name']]
name = [status.get('name', None)]
description = [status.get('description', None)]
if description == name is None:
return fromn
elif description is None:
return fromn.extend(name)
elif name is None:
return fromn.extend(description)
else:
return fromn + name + description
私のコードは 1 つの文字列しか返しませんが、 returnの代わりにprintを使用すると、すべての結果が出力されます。印刷の場合と同じ結果を返すにはどうすればよいですか??