Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Better solution with tsv data
- #Simpler, unicode support, google spreadsheet support
- import requests #http://docs.python-requests.org/en/master/
- def unicode_normalize(text):
- return text.translate({ 0x2018:0x27, 0x2019:0x27, 0x201C:0x22, 0x201D:0x22, 0xa0:0x20 }).encode('utf-8')
- #init full_GraphAPI_for_group_or_page_URL
- #...
- feed_json = requests.get(full_GraphAPI_for_group_or_page_URL).json()
- tsv_row = []
- for item in feed_json["data"]:
- tsv_row = [item["id"]] + [item["message"]] + [item["created_time"]] # + ... so on
- print unicode_normalize("\t".join(tsv_row))
- #Save to this_script.py then run "this_script.py >> data.tsv" from command line
- #Open data.tsv with notepad or sublime > Copy All then paste to Google Spreadsheet for better data manipulation and sharing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement