{"action":"created","comment":{"url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/comments/72113941","id":72113941,"diff_hunk":"@@ -24,90 +19,127 @@ function makeApiCall(oauthOptions, callback, hashtag) {\n     });\n }\n \n-// ~~~~~~~~~~~~~~~~~~~~~~ posts ~~~~~~~~~~~~~~~~~~~~~~~\n+// ~~~~~~~~~~~~~~~~~~~~~~ photos ~~~~~~~~~~~~~~~~~~~~~~~\n \n-function getPagePosts(options, callback) {\n+function getPhotoPosts(options) {\n     var oauthOptions = {\n         url: 'https://graph.facebook.com/v2.6/' + options['pageId'] + '?fields=albums{photos{created_time,id,name,likes.limit(1).summary(true),comments.limit(1).summary(true),images, from}}&access_token=' + options['appId'] + '|' + options['appSecret'],\n         JSON: true\n     };\n-    makeApiCall(oauthOptions, callback);  \n+    makeApiCall(oauthOptions, makePhotoArray);  \n }\n \n-function printPagePosts(data) {\n-    console.log('\\n\\n\\n')\n-    for (var i = 0; i < data['albums']['data'].length; i++) // albums\n-    {\n-       console.log('~~~~~~~~~~~~~~~~~~~~~~~~ album: ', i);\n-       for (var j = 0; j < data['albums']['data'][i]['photos']['data'].length; j++) { // items in albums\n-           console.log('-------------------');\n-           console.log('id:', data['albums']['data'][i]['photos']['data'][j]['id']);\n-           console.log('created_time:', data['albums']['data'][i]['photos']['data'][j]['created_time']);\n-           console.log('from: ', data['albums']['data'][i]['photos']['data'][j]['from']);\n-            if (data['albums']['data'][i]['photos']['data'][j].hasOwnProperty('name'))\n-                console.log('description:', data['albums']['data'][i]['photos']['data'][j]['name']);\n-            else\n-                console.log('description: ');\n-             \n-            console.log('url:', data['albums']['data'][i]['photos']['data'][j]['images'][0]['source']);\n-            console.log('likes:', data['albums']['data'][i]['photos']['data'][j]['likes']['summary']['total_count']);\n-            console.log('comments:', data['albums']['data'][i]['photos']['data'][j]['comments']['summary']['total_count']);\n-        }\n-    }\n+function makePhotoObject(data){\n+    var object = {};\n+    var dateOptions = { year: 'numeric', month: '2-digit', day: '2-digit', \n+                        hour: '2-digit', minute: '2-digit', second: '2-digit' };\n+    object['_id'] = 'fb' + data.id;\n+    date = new Date(data.created_time);\n+    object.date = date.toLocaleString('ko-KR', dateOptions);\n+    object.from = data.from;\n+    if (data.hasOwnProperty('name'))","path":"ProjectHub2/services/facebookService.js","position":56,"original_position":56,"commit_id":"e8d4c6a7e259335d148a8848d10bebdb4dd0fe9f","original_commit_id":"e8d4c6a7e259335d148a8848d10bebdb4dd0fe9f","user":{"login":"kestux","id":4324521,"avatar_url":"https://avatars.githubusercontent.com/u/4324521?v=3","gravatar_id":"","url":"https://api.github.com/users/kestux","html_url":"https://github.com/kestux","followers_url":"https://api.github.com/users/kestux/followers","following_url":"https://api.github.com/users/kestux/following{/other_user}","gists_url":"https://api.github.com/users/kestux/gists{/gist_id}","starred_url":"https://api.github.com/users/kestux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kestux/subscriptions","organizations_url":"https://api.github.com/users/kestux/orgs","repos_url":"https://api.github.com/users/kestux/repos","events_url":"https://api.github.com/users/kestux/events{/privacy}","received_events_url":"https://api.github.com/users/kestux/received_events","type":"User","site_admin":false},"body":"it is on company's policy to use `{` and `}` after ALL conditionals (`if`, `for`, `while` etc)","created_at":"2016-07-25T18:06:57Z","updated_at":"2016-07-25T18:06:57Z","html_url":"https://github.com/viliusvaic/projecthub2/pull/2#discussion_r72113941","pull_request_url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/comments/72113941"},"html":{"href":"https://github.com/viliusvaic/projecthub2/pull/2#discussion_r72113941"},"pull_request":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2","id":78656516,"html_url":"https://github.com/viliusvaic/projecthub2/pull/2","diff_url":"https://github.com/viliusvaic/projecthub2/pull/2.diff","patch_url":"https://github.com/viliusvaic/projecthub2/pull/2.patch","issue_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues/2","number":2,"state":"closed","locked":false,"title":"The stuff","user":{"login":"Greta741","id":20437348,"avatar_url":"https://avatars.githubusercontent.com/u/20437348?v=3","gravatar_id":"","url":"https://api.github.com/users/Greta741","html_url":"https://github.com/Greta741","followers_url":"https://api.github.com/users/Greta741/followers","following_url":"https://api.github.com/users/Greta741/following{/other_user}","gists_url":"https://api.github.com/users/Greta741/gists{/gist_id}","starred_url":"https://api.github.com/users/Greta741/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Greta741/subscriptions","organizations_url":"https://api.github.com/users/Greta741/orgs","repos_url":"https://api.github.com/users/Greta741/repos","events_url":"https://api.github.com/users/Greta741/events{/privacy}","received_events_url":"https://api.github.com/users/Greta741/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-25T10:11:40Z","updated_at":"2016-07-25T18:06:57Z","closed_at":"2016-07-25T10:14:53Z","merged_at":"2016-07-25T10:14:53Z","merge_commit_sha":"f31b5e53e47141e9ea39bb8819ab3bee608d20cc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2/commits","review_comments_url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2/comments","review_comment_url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues/2/comments","statuses_url":"https://api.github.com/repos/viliusvaic/projecthub2/statuses/e8d4c6a7e259335d148a8848d10bebdb4dd0fe9f","head":{"label":"viliusvaic:Greta","ref":"Greta","sha":"e8d4c6a7e259335d148a8848d10bebdb4dd0fe9f","user":{"login":"viliusvaic","id":9074397,"avatar_url":"https://avatars.githubusercontent.com/u/9074397?v=3","gravatar_id":"","url":"https://api.github.com/users/viliusvaic","html_url":"https://github.com/viliusvaic","followers_url":"https://api.github.com/users/viliusvaic/followers","following_url":"https://api.github.com/users/viliusvaic/following{/other_user}","gists_url":"https://api.github.com/users/viliusvaic/gists{/gist_id}","starred_url":"https://api.github.com/users/viliusvaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viliusvaic/subscriptions","organizations_url":"https://api.github.com/users/viliusvaic/orgs","repos_url":"https://api.github.com/users/viliusvaic/repos","events_url":"https://api.github.com/users/viliusvaic/events{/privacy}","received_events_url":"https://api.github.com/users/viliusvaic/received_events","type":"User","site_admin":false},"repo":{"id":63236495,"name":"projecthub2","full_name":"viliusvaic/projecthub2","owner":{"login":"viliusvaic","id":9074397,"avatar_url":"https://avatars.githubusercontent.com/u/9074397?v=3","gravatar_id":"","url":"https://api.github.com/users/viliusvaic","html_url":"https://github.com/viliusvaic","followers_url":"https://api.github.com/users/viliusvaic/followers","following_url":"https://api.github.com/users/viliusvaic/following{/other_user}","gists_url":"https://api.github.com/users/viliusvaic/gists{/gist_id}","starred_url":"https://api.github.com/users/viliusvaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viliusvaic/subscriptions","organizations_url":"https://api.github.com/users/viliusvaic/orgs","repos_url":"https://api.github.com/users/viliusvaic/repos","events_url":"https://api.github.com/users/viliusvaic/events{/privacy}","received_events_url":"https://api.github.com/users/viliusvaic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/viliusvaic/projecthub2","description":null,"fork":false,"url":"https://api.github.com/repos/viliusvaic/projecthub2","forks_url":"https://api.github.com/repos/viliusvaic/projecthub2/forks","keys_url":"https://api.github.com/repos/viliusvaic/projecthub2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/viliusvaic/projecthub2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/viliusvaic/projecthub2/teams","hooks_url":"https://api.github.com/repos/viliusvaic/projecthub2/hooks","issue_events_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues/events{/number}","events_url":"https://api.github.com/repos/viliusvaic/projecthub2/events","assignees_url":"https://api.github.com/repos/viliusvaic/projecthub2/assignees{/user}","branches_url":"https://api.github.com/repos/viliusvaic/projecthub2/branches{/branch}","tags_url":"https://api.github.com/repos/viliusvaic/projecthub2/tags","blobs_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/refs{/sha}","trees_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/viliusvaic/projecthub2/statuses/{sha}","languages_url":"https://api.github.com/repos/viliusvaic/projecthub2/languages","stargazers_url":"https://api.github.com/repos/viliusvaic/projecthub2/stargazers","contributors_url":"https://api.github.com/repos/viliusvaic/projecthub2/contributors","subscribers_url":"https://api.github.com/repos/viliusvaic/projecthub2/subscribers","subscription_url":"https://api.github.com/repos/viliusvaic/projecthub2/subscription","commits_url":"https://api.github.com/repos/viliusvaic/projecthub2/commits{/sha}","git_commits_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/commits{/sha}","comments_url":"https://api.github.com/repos/viliusvaic/projecthub2/comments{/number}","issue_comment_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues/comments{/number}","contents_url":"https://api.github.com/repos/viliusvaic/projecthub2/contents/{+path}","compare_url":"https://api.github.com/repos/viliusvaic/projecthub2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/viliusvaic/projecthub2/merges","archive_url":"https://api.github.com/repos/viliusvaic/projecthub2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/viliusvaic/projecthub2/downloads","issues_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues{/number}","pulls_url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls{/number}","milestones_url":"https://api.github.com/repos/viliusvaic/projecthub2/milestones{/number}","notifications_url":"https://api.github.com/repos/viliusvaic/projecthub2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/viliusvaic/projecthub2/labels{/name}","releases_url":"https://api.github.com/repos/viliusvaic/projecthub2/releases{/id}","deployments_url":"https://api.github.com/repos/viliusvaic/projecthub2/deployments","created_at":"2016-07-13T10:17:32Z","updated_at":"2016-07-18T18:40:43Z","pushed_at":"2016-07-25T10:25:29Z","git_url":"git://github.com/viliusvaic/projecthub2.git","ssh_url":"git@github.com:viliusvaic/projecthub2.git","clone_url":"https://github.com/viliusvaic/projecthub2.git","svn_url":"https://github.com/viliusvaic/projecthub2","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"viliusvaic:master","ref":"master","sha":"669df11ca9ae126243922ff6fcddef935fe4ea56","user":{"login":"viliusvaic","id":9074397,"avatar_url":"https://avatars.githubusercontent.com/u/9074397?v=3","gravatar_id":"","url":"https://api.github.com/users/viliusvaic","html_url":"https://github.com/viliusvaic","followers_url":"https://api.github.com/users/viliusvaic/followers","following_url":"https://api.github.com/users/viliusvaic/following{/other_user}","gists_url":"https://api.github.com/users/viliusvaic/gists{/gist_id}","starred_url":"https://api.github.com/users/viliusvaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viliusvaic/subscriptions","organizations_url":"https://api.github.com/users/viliusvaic/orgs","repos_url":"https://api.github.com/users/viliusvaic/repos","events_url":"https://api.github.com/users/viliusvaic/events{/privacy}","received_events_url":"https://api.github.com/users/viliusvaic/received_events","type":"User","site_admin":false},"repo":{"id":63236495,"name":"projecthub2","full_name":"viliusvaic/projecthub2","owner":{"login":"viliusvaic","id":9074397,"avatar_url":"https://avatars.githubusercontent.com/u/9074397?v=3","gravatar_id":"","url":"https://api.github.com/users/viliusvaic","html_url":"https://github.com/viliusvaic","followers_url":"https://api.github.com/users/viliusvaic/followers","following_url":"https://api.github.com/users/viliusvaic/following{/other_user}","gists_url":"https://api.github.com/users/viliusvaic/gists{/gist_id}","starred_url":"https://api.github.com/users/viliusvaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viliusvaic/subscriptions","organizations_url":"https://api.github.com/users/viliusvaic/orgs","repos_url":"https://api.github.com/users/viliusvaic/repos","events_url":"https://api.github.com/users/viliusvaic/events{/privacy}","received_events_url":"https://api.github.com/users/viliusvaic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/viliusvaic/projecthub2","description":null,"fork":false,"url":"https://api.github.com/repos/viliusvaic/projecthub2","forks_url":"https://api.github.com/repos/viliusvaic/projecthub2/forks","keys_url":"https://api.github.com/repos/viliusvaic/projecthub2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/viliusvaic/projecthub2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/viliusvaic/projecthub2/teams","hooks_url":"https://api.github.com/repos/viliusvaic/projecthub2/hooks","issue_events_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues/events{/number}","events_url":"https://api.github.com/repos/viliusvaic/projecthub2/events","assignees_url":"https://api.github.com/repos/viliusvaic/projecthub2/assignees{/user}","branches_url":"https://api.github.com/repos/viliusvaic/projecthub2/branches{/branch}","tags_url":"https://api.github.com/repos/viliusvaic/projecthub2/tags","blobs_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/refs{/sha}","trees_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/viliusvaic/projecthub2/statuses/{sha}","languages_url":"https://api.github.com/repos/viliusvaic/projecthub2/languages","stargazers_url":"https://api.github.com/repos/viliusvaic/projecthub2/stargazers","contributors_url":"https://api.github.com/repos/viliusvaic/projecthub2/contributors","subscribers_url":"https://api.github.com/repos/viliusvaic/projecthub2/subscribers","subscription_url":"https://api.github.com/repos/viliusvaic/projecthub2/subscription","commits_url":"https://api.github.com/repos/viliusvaic/projecthub2/commits{/sha}","git_commits_url":"https://api.github.com/repos/viliusvaic/projecthub2/git/commits{/sha}","comments_url":"https://api.github.com/repos/viliusvaic/projecthub2/comments{/number}","issue_comment_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues/comments{/number}","contents_url":"https://api.github.com/repos/viliusvaic/projecthub2/contents/{+path}","compare_url":"https://api.github.com/repos/viliusvaic/projecthub2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/viliusvaic/projecthub2/merges","archive_url":"https://api.github.com/repos/viliusvaic/projecthub2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/viliusvaic/projecthub2/downloads","issues_url":"https://api.github.com/repos/viliusvaic/projecthub2/issues{/number}","pulls_url":"https://api.github.com/repos/viliusvaic/projecthub2/pulls{/number}","milestones_url":"https://api.github.com/repos/viliusvaic/projecthub2/milestones{/number}","notifications_url":"https://api.github.com/repos/viliusvaic/projecthub2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/viliusvaic/projecthub2/labels{/name}","releases_url":"https://api.github.com/repos/viliusvaic/projecthub2/releases{/id}","deployments_url":"https://api.github.com/repos/viliusvaic/projecthub2/deployments","created_at":"2016-07-13T10:17:32Z","updated_at":"2016-07-18T18:40:43Z","pushed_at":"2016-07-25T10:25:29Z","git_url":"git://github.com/viliusvaic/projecthub2.git","ssh_url":"git@github.com:viliusvaic/projecthub2.git","clone_url":"https://github.com/viliusvaic/projecthub2.git","svn_url":"https://github.com/viliusvaic/projecthub2","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2"},"html":{"href":"https://github.com/viliusvaic/projecthub2/pull/2"},"issue":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/issues/2"},"comments":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/viliusvaic/projecthub2/statuses/e8d4c6a7e259335d148a8848d10bebdb4dd0fe9f"}}}}
{"actor":{"display_login":"kestux"}}