{"action":"created","comment":{"url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/comments/189109324","pull_request_review_id":121226163,"id":189109324,"diff_hunk":"@@ -17,16 +17,21 @@\n you = 'You'\n partner = 'Partner'\n \n+# Convert unicode characters into what Python expects them to look like\n+for message in data['messages']:\n+\tmessage['sender_name'] = message['sender_name'].encode('raw_unicode_escape').decode('utf-8')\n+\tif 'content' in message:\n+\t\tmessage['content'] = message['content'].encode('raw_unicode_escape').decode('utf-8')\n+\n+# Sort the messages by time\n+data['messages'] = sorted(data['messages'], key=lambda message: message['timestamp'])","path":"facebook_chat_statistics.py","position":null,"original_position":11,"commit_id":"39d301939c62534426ddb4ba2b4744fa62ef56bd","original_commit_id":"d552b7817120a553ff65dbb6bedbe7273abb6cad","user":{"login":"landalex","id":5572311,"avatar_url":"https://avatars1.githubusercontent.com/u/5572311?v=4","gravatar_id":"","url":"https://api.github.com/users/landalex","html_url":"https://github.com/landalex","followers_url":"https://api.github.com/users/landalex/followers","following_url":"https://api.github.com/users/landalex/following{/other_user}","gists_url":"https://api.github.com/users/landalex/gists{/gist_id}","starred_url":"https://api.github.com/users/landalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landalex/subscriptions","organizations_url":"https://api.github.com/users/landalex/orgs","repos_url":"https://api.github.com/users/landalex/repos","events_url":"https://api.github.com/users/landalex/events{/privacy}","received_events_url":"https://api.github.com/users/landalex/received_events","type":"User","site_admin":false},"body":"Sorry, that was a typo. The newly downloaded one is in order, the older one is not.","created_at":"2018-05-17T21:37:53Z","updated_at":"2018-05-17T21:37:53Z","html_url":"https://github.com/davidkrantz/FacebookChatStatistics/pull/2#discussion_r189109324","pull_request_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/comments/189109324"},"html":{"href":"https://github.com/davidkrantz/FacebookChatStatistics/pull/2#discussion_r189109324"},"pull_request":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2"}},"in_reply_to_id":188917823},"pull_request":{"url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2","id":188238973,"html_url":"https://github.com/davidkrantz/FacebookChatStatistics/pull/2","diff_url":"https://github.com/davidkrantz/FacebookChatStatistics/pull/2.diff","patch_url":"https://github.com/davidkrantz/FacebookChatStatistics/pull/2.patch","issue_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues/2","number":2,"state":"open","locked":false,"title":"Use new message archive format, closes #1","user":{"login":"landalex","id":5572311,"avatar_url":"https://avatars1.githubusercontent.com/u/5572311?v=4","gravatar_id":"","url":"https://api.github.com/users/landalex","html_url":"https://github.com/landalex","followers_url":"https://api.github.com/users/landalex/followers","following_url":"https://api.github.com/users/landalex/following{/other_user}","gists_url":"https://api.github.com/users/landalex/gists{/gist_id}","starred_url":"https://api.github.com/users/landalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landalex/subscriptions","organizations_url":"https://api.github.com/users/landalex/orgs","repos_url":"https://api.github.com/users/landalex/repos","events_url":"https://api.github.com/users/landalex/events{/privacy}","received_events_url":"https://api.github.com/users/landalex/received_events","type":"User","site_admin":false},"body":"Closes #1 \r\n\r\nThis PR changes the existing script to use the new message archive format (used by Facebook). Most of the changes are just accessing the data differently, but some preprocessing work has been added, which includes converting to a format of UTF-8 that Python likes, and sorting the messages by time sent.\r\n\r\nAlso, loops were changed to use the standard syntax for iterables.\r\n\r\nI've tested with my own data, but please check that the same results are returned with yours!","created_at":"2018-05-15T19:59:51Z","updated_at":"2018-05-17T21:37:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ee09e976f0914c17b4218b4e2fa2e6f03c9b63a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2/commits","review_comments_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2/comments","review_comment_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues/2/comments","statuses_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/statuses/39d301939c62534426ddb4ba2b4744fa62ef56bd","head":{"label":"landalex:master","ref":"master","sha":"39d301939c62534426ddb4ba2b4744fa62ef56bd","user":{"login":"landalex","id":5572311,"avatar_url":"https://avatars1.githubusercontent.com/u/5572311?v=4","gravatar_id":"","url":"https://api.github.com/users/landalex","html_url":"https://github.com/landalex","followers_url":"https://api.github.com/users/landalex/followers","following_url":"https://api.github.com/users/landalex/following{/other_user}","gists_url":"https://api.github.com/users/landalex/gists{/gist_id}","starred_url":"https://api.github.com/users/landalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landalex/subscriptions","organizations_url":"https://api.github.com/users/landalex/orgs","repos_url":"https://api.github.com/users/landalex/repos","events_url":"https://api.github.com/users/landalex/events{/privacy}","received_events_url":"https://api.github.com/users/landalex/received_events","type":"User","site_admin":false},"repo":{"id":133562232,"name":"FacebookChatStatistics","full_name":"landalex/FacebookChatStatistics","owner":{"login":"landalex","id":5572311,"avatar_url":"https://avatars1.githubusercontent.com/u/5572311?v=4","gravatar_id":"","url":"https://api.github.com/users/landalex","html_url":"https://github.com/landalex","followers_url":"https://api.github.com/users/landalex/followers","following_url":"https://api.github.com/users/landalex/following{/other_user}","gists_url":"https://api.github.com/users/landalex/gists{/gist_id}","starred_url":"https://api.github.com/users/landalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landalex/subscriptions","organizations_url":"https://api.github.com/users/landalex/orgs","repos_url":"https://api.github.com/users/landalex/repos","events_url":"https://api.github.com/users/landalex/events{/privacy}","received_events_url":"https://api.github.com/users/landalex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/landalex/FacebookChatStatistics","description":"Facebook Chat Statistics","fork":true,"url":"https://api.github.com/repos/landalex/FacebookChatStatistics","forks_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/forks","keys_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/teams","hooks_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/hooks","issue_events_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/issues/events{/number}","events_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/events","assignees_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/assignees{/user}","branches_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/branches{/branch}","tags_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/tags","blobs_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/git/refs{/sha}","trees_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/statuses/{sha}","languages_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/languages","stargazers_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/stargazers","contributors_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/contributors","subscribers_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/subscribers","subscription_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/subscription","commits_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/commits{/sha}","git_commits_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/git/commits{/sha}","comments_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/comments{/number}","issue_comment_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/issues/comments{/number}","contents_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/contents/{+path}","compare_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/merges","archive_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/downloads","issues_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/issues{/number}","pulls_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/pulls{/number}","milestones_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/milestones{/number}","notifications_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/labels{/name}","releases_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/releases{/id}","deployments_url":"https://api.github.com/repos/landalex/FacebookChatStatistics/deployments","created_at":"2018-05-15T19:15:25Z","updated_at":"2018-05-17T17:36:08Z","pushed_at":"2018-05-17T17:36:07Z","git_url":"git://github.com/landalex/FacebookChatStatistics.git","ssh_url":"git@github.com:landalex/FacebookChatStatistics.git","clone_url":"https://github.com/landalex/FacebookChatStatistics.git","svn_url":"https://github.com/landalex/FacebookChatStatistics","homepage":null,"size":1283,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"davidkrantz:master","ref":"master","sha":"a3738f5ba5b7fbb71eff5d0fd81383498994e0da","user":{"login":"davidkrantz","id":26110611,"avatar_url":"https://avatars2.githubusercontent.com/u/26110611?v=4","gravatar_id":"","url":"https://api.github.com/users/davidkrantz","html_url":"https://github.com/davidkrantz","followers_url":"https://api.github.com/users/davidkrantz/followers","following_url":"https://api.github.com/users/davidkrantz/following{/other_user}","gists_url":"https://api.github.com/users/davidkrantz/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkrantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkrantz/subscriptions","organizations_url":"https://api.github.com/users/davidkrantz/orgs","repos_url":"https://api.github.com/users/davidkrantz/repos","events_url":"https://api.github.com/users/davidkrantz/events{/privacy}","received_events_url":"https://api.github.com/users/davidkrantz/received_events","type":"User","site_admin":false},"repo":{"id":122451059,"name":"FacebookChatStatistics","full_name":"davidkrantz/FacebookChatStatistics","owner":{"login":"davidkrantz","id":26110611,"avatar_url":"https://avatars2.githubusercontent.com/u/26110611?v=4","gravatar_id":"","url":"https://api.github.com/users/davidkrantz","html_url":"https://github.com/davidkrantz","followers_url":"https://api.github.com/users/davidkrantz/followers","following_url":"https://api.github.com/users/davidkrantz/following{/other_user}","gists_url":"https://api.github.com/users/davidkrantz/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkrantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkrantz/subscriptions","organizations_url":"https://api.github.com/users/davidkrantz/orgs","repos_url":"https://api.github.com/users/davidkrantz/repos","events_url":"https://api.github.com/users/davidkrantz/events{/privacy}","received_events_url":"https://api.github.com/users/davidkrantz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidkrantz/FacebookChatStatistics","description":"Facebook Chat Statistics","fork":false,"url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics","forks_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/forks","keys_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/teams","hooks_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/hooks","issue_events_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues/events{/number}","events_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/events","assignees_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/assignees{/user}","branches_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/branches{/branch}","tags_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/tags","blobs_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/statuses/{sha}","languages_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/languages","stargazers_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/stargazers","contributors_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/contributors","subscribers_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/subscribers","subscription_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/subscription","commits_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/contents/{+path}","compare_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/merges","archive_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/downloads","issues_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues{/number}","pulls_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls{/number}","milestones_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/milestones{/number}","notifications_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/labels{/name}","releases_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/releases{/id}","deployments_url":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/deployments","created_at":"2018-02-22T08:32:07Z","updated_at":"2018-02-22T09:04:21Z","pushed_at":"2018-05-17T19:02:59Z","git_url":"git://github.com/davidkrantz/FacebookChatStatistics.git","ssh_url":"git@github.com:davidkrantz/FacebookChatStatistics.git","clone_url":"https://github.com/davidkrantz/FacebookChatStatistics.git","svn_url":"https://github.com/davidkrantz/FacebookChatStatistics","homepage":null,"size":1281,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2"},"html":{"href":"https://github.com/davidkrantz/FacebookChatStatistics/pull/2"},"issue":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues/2"},"comments":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/davidkrantz/FacebookChatStatistics/statuses/39d301939c62534426ddb4ba2b4744fa62ef56bd"}},"author_association":"NONE"}}
{"actor":{"display_login":"landalex"}}