{"action":"created","comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments/135137581","pull_request_review_id":58518256,"id":135137581,"diff_hunk":"@@ -0,0 +1,52 @@\n+const axios = require(`axios`)\n+const crypto = require(`crypto`)\n+\n+const fetch = username => {\n+  const url = `https://medium.com/${username}/latest?format=json`\n+  return axios.get(url)\n+}\n+\n+const prefix = `])}while(1);</x>`\n+\n+const strip = payload => payload.replace(prefix, ``)\n+\n+exports.sourceNodes = async ({ boundActionCreators }, { username }) => {\n+  const { createNode } = boundActionCreators\n+\n+  try {\n+    const result = await fetch(username)\n+    const json = JSON.parse(strip(result.data))\n+\n+    const { posts } = json.payload\n+    const collectionKeys = Object.keys(json.payload.references.Collection)\n+    const userKeys = Object.keys(json.payload.references.User)\n+\n+    const importableResources = [\n+      posts,\n+      collectionKeys.map(key => json.payload.references.Collection[key]),\n+      userKeys.map(key => json.payload.references.User[key]),\n+    ]\n+\n+    const resources = Array.prototype.concat(...importableResources)\n+    resources.map(resource => {\n+      const digest = crypto.createHash(`md5`).update(JSON.stringify(resource)).digest(`hex`)\n+\n+      const node = Object.assign(resource, {\n+        id: resource.id ? resource.id : resource.userId,\n+        parent: `__SOURCE__`,\n+        children: [],\n+        internal: {\n+          mediaType: `application/json`,","path":"packages/gatsby-source-medium/src/gatsby-node.js","position":39,"original_position":39,"commit_id":"277b8ac2e654b73e04a34482adbf54375c5d5d6a","original_commit_id":"277b8ac2e654b73e04a34482adbf54375c5d5d6a","user":{"login":"KyleAMathews","id":71047,"avatar_url":"https://avatars3.githubusercontent.com/u/71047?v=4","gravatar_id":"","url":"https://api.github.com/users/KyleAMathews","html_url":"https://github.com/KyleAMathews","followers_url":"https://api.github.com/users/KyleAMathews/followers","following_url":"https://api.github.com/users/KyleAMathews/following{/other_user}","gists_url":"https://api.github.com/users/KyleAMathews/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleAMathews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleAMathews/subscriptions","organizations_url":"https://api.github.com/users/KyleAMathews/orgs","repos_url":"https://api.github.com/users/KyleAMathews/repos","events_url":"https://api.github.com/users/KyleAMathews/events{/privacy}","received_events_url":"https://api.github.com/users/KyleAMathews/received_events","type":"User","site_admin":false},"body":"`mediaType` isn't needed unless the node content can be transformed into something else e.g. `text/x-markdown`. In these cases, the `mediaType` is a signal to transformer plugins that they can transform the node.","created_at":"2017-08-24T21:38:42Z","updated_at":"2017-08-24T21:41:42Z","html_url":"https://github.com/gatsbyjs/gatsby/pull/1907#discussion_r135137581","pull_request_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907","_links":{"self":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments/135137581"},"html":{"href":"https://github.com/gatsbyjs/gatsby/pull/1907#discussion_r135137581"},"pull_request":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907"}}},"pull_request":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907","id":137554446,"html_url":"https://github.com/gatsbyjs/gatsby/pull/1907","diff_url":"https://github.com/gatsbyjs/gatsby/pull/1907.diff","patch_url":"https://github.com/gatsbyjs/gatsby/pull/1907.patch","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1907","number":1907,"state":"open","locked":false,"title":"[gatsby-source-medium] Add Medium Source","user":{"login":"deniaz","id":698963,"avatar_url":"https://avatars0.githubusercontent.com/u/698963?v=4","gravatar_id":"","url":"https://api.github.com/users/deniaz","html_url":"https://github.com/deniaz","followers_url":"https://api.github.com/users/deniaz/followers","following_url":"https://api.github.com/users/deniaz/following{/other_user}","gists_url":"https://api.github.com/users/deniaz/gists{/gist_id}","starred_url":"https://api.github.com/users/deniaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniaz/subscriptions","organizations_url":"https://api.github.com/users/deniaz/orgs","repos_url":"https://api.github.com/users/deniaz/repos","events_url":"https://api.github.com/users/deniaz/events{/privacy}","received_events_url":"https://api.github.com/users/deniaz/received_events","type":"User","site_admin":false},"body":"Hey again ;)\r\n\r\nWe wanted to display our latest Medium stories on our company website and wrote a small plugin to pull in the data.\r\n\r\nDoes it make sense to merge this into your repo or shall we just publish it regularly with npm?\r\n\r\nYour call!\r\n\r\nCheers,\r\nRob","created_at":"2017-08-24T21:21:21Z","updated_at":"2017-08-24T21:41:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14ae87f0d738fb41987bfdf9f78a4d3e49ea897b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907/commits","review_comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907/comments","review_comment_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1907/comments","statuses_url":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/277b8ac2e654b73e04a34482adbf54375c5d5d6a","head":{"label":"deniaz:feature/source-medium","ref":"feature/source-medium","sha":"277b8ac2e654b73e04a34482adbf54375c5d5d6a","user":{"login":"deniaz","id":698963,"avatar_url":"https://avatars0.githubusercontent.com/u/698963?v=4","gravatar_id":"","url":"https://api.github.com/users/deniaz","html_url":"https://github.com/deniaz","followers_url":"https://api.github.com/users/deniaz/followers","following_url":"https://api.github.com/users/deniaz/following{/other_user}","gists_url":"https://api.github.com/users/deniaz/gists{/gist_id}","starred_url":"https://api.github.com/users/deniaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniaz/subscriptions","organizations_url":"https://api.github.com/users/deniaz/orgs","repos_url":"https://api.github.com/users/deniaz/repos","events_url":"https://api.github.com/users/deniaz/events{/privacy}","received_events_url":"https://api.github.com/users/deniaz/received_events","type":"User","site_admin":false},"repo":{"id":101299892,"name":"gatsby","full_name":"deniaz/gatsby","owner":{"login":"deniaz","id":698963,"avatar_url":"https://avatars0.githubusercontent.com/u/698963?v=4","gravatar_id":"","url":"https://api.github.com/users/deniaz","html_url":"https://github.com/deniaz","followers_url":"https://api.github.com/users/deniaz/followers","following_url":"https://api.github.com/users/deniaz/following{/other_user}","gists_url":"https://api.github.com/users/deniaz/gists{/gist_id}","starred_url":"https://api.github.com/users/deniaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniaz/subscriptions","organizations_url":"https://api.github.com/users/deniaz/orgs","repos_url":"https://api.github.com/users/deniaz/repos","events_url":"https://api.github.com/users/deniaz/events{/privacy}","received_events_url":"https://api.github.com/users/deniaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deniaz/gatsby","description":"⚛️📄🚀 Blazing fast static site generator for React","fork":true,"url":"https://api.github.com/repos/deniaz/gatsby","forks_url":"https://api.github.com/repos/deniaz/gatsby/forks","keys_url":"https://api.github.com/repos/deniaz/gatsby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deniaz/gatsby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deniaz/gatsby/teams","hooks_url":"https://api.github.com/repos/deniaz/gatsby/hooks","issue_events_url":"https://api.github.com/repos/deniaz/gatsby/issues/events{/number}","events_url":"https://api.github.com/repos/deniaz/gatsby/events","assignees_url":"https://api.github.com/repos/deniaz/gatsby/assignees{/user}","branches_url":"https://api.github.com/repos/deniaz/gatsby/branches{/branch}","tags_url":"https://api.github.com/repos/deniaz/gatsby/tags","blobs_url":"https://api.github.com/repos/deniaz/gatsby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deniaz/gatsby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deniaz/gatsby/git/refs{/sha}","trees_url":"https://api.github.com/repos/deniaz/gatsby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deniaz/gatsby/statuses/{sha}","languages_url":"https://api.github.com/repos/deniaz/gatsby/languages","stargazers_url":"https://api.github.com/repos/deniaz/gatsby/stargazers","contributors_url":"https://api.github.com/repos/deniaz/gatsby/contributors","subscribers_url":"https://api.github.com/repos/deniaz/gatsby/subscribers","subscription_url":"https://api.github.com/repos/deniaz/gatsby/subscription","commits_url":"https://api.github.com/repos/deniaz/gatsby/commits{/sha}","git_commits_url":"https://api.github.com/repos/deniaz/gatsby/git/commits{/sha}","comments_url":"https://api.github.com/repos/deniaz/gatsby/comments{/number}","issue_comment_url":"https://api.github.com/repos/deniaz/gatsby/issues/comments{/number}","contents_url":"https://api.github.com/repos/deniaz/gatsby/contents/{+path}","compare_url":"https://api.github.com/repos/deniaz/gatsby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deniaz/gatsby/merges","archive_url":"https://api.github.com/repos/deniaz/gatsby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deniaz/gatsby/downloads","issues_url":"https://api.github.com/repos/deniaz/gatsby/issues{/number}","pulls_url":"https://api.github.com/repos/deniaz/gatsby/pulls{/number}","milestones_url":"https://api.github.com/repos/deniaz/gatsby/milestones{/number}","notifications_url":"https://api.github.com/repos/deniaz/gatsby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deniaz/gatsby/labels{/name}","releases_url":"https://api.github.com/repos/deniaz/gatsby/releases{/id}","deployments_url":"https://api.github.com/repos/deniaz/gatsby/deployments","created_at":"2017-08-24T13:49:15Z","updated_at":"2017-08-24T13:49:18Z","pushed_at":"2017-08-24T21:15:52Z","git_url":"git://github.com/deniaz/gatsby.git","ssh_url":"git@github.com:deniaz/gatsby.git","clone_url":"https://github.com/deniaz/gatsby.git","svn_url":"https://github.com/deniaz/gatsby","homepage":"https://www.gatsbyjs.org","size":140201,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"gatsbyjs:master","ref":"master","sha":"cd68468c0f02dfb1700b464b91da518aa3dd3884","user":{"login":"gatsbyjs","id":12551863,"avatar_url":"https://avatars1.githubusercontent.com/u/12551863?v=4","gravatar_id":"","url":"https://api.github.com/users/gatsbyjs","html_url":"https://github.com/gatsbyjs","followers_url":"https://api.github.com/users/gatsbyjs/followers","following_url":"https://api.github.com/users/gatsbyjs/following{/other_user}","gists_url":"https://api.github.com/users/gatsbyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gatsbyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatsbyjs/subscriptions","organizations_url":"https://api.github.com/users/gatsbyjs/orgs","repos_url":"https://api.github.com/users/gatsbyjs/repos","events_url":"https://api.github.com/users/gatsbyjs/events{/privacy}","received_events_url":"https://api.github.com/users/gatsbyjs/received_events","type":"Organization","site_admin":false},"repo":{"id":36040894,"name":"gatsby","full_name":"gatsbyjs/gatsby","owner":{"login":"gatsbyjs","id":12551863,"avatar_url":"https://avatars1.githubusercontent.com/u/12551863?v=4","gravatar_id":"","url":"https://api.github.com/users/gatsbyjs","html_url":"https://github.com/gatsbyjs","followers_url":"https://api.github.com/users/gatsbyjs/followers","following_url":"https://api.github.com/users/gatsbyjs/following{/other_user}","gists_url":"https://api.github.com/users/gatsbyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gatsbyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatsbyjs/subscriptions","organizations_url":"https://api.github.com/users/gatsbyjs/orgs","repos_url":"https://api.github.com/users/gatsbyjs/repos","events_url":"https://api.github.com/users/gatsbyjs/events{/privacy}","received_events_url":"https://api.github.com/users/gatsbyjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gatsbyjs/gatsby","description":"⚛️📄🚀 Blazing fast static site generator for React","fork":false,"url":"https://api.github.com/repos/gatsbyjs/gatsby","forks_url":"https://api.github.com/repos/gatsbyjs/gatsby/forks","keys_url":"https://api.github.com/repos/gatsbyjs/gatsby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gatsbyjs/gatsby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gatsbyjs/gatsby/teams","hooks_url":"https://api.github.com/repos/gatsbyjs/gatsby/hooks","issue_events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/events{/number}","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/events","assignees_url":"https://api.github.com/repos/gatsbyjs/gatsby/assignees{/user}","branches_url":"https://api.github.com/repos/gatsbyjs/gatsby/branches{/branch}","tags_url":"https://api.github.com/repos/gatsbyjs/gatsby/tags","blobs_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/refs{/sha}","trees_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/{sha}","languages_url":"https://api.github.com/repos/gatsbyjs/gatsby/languages","stargazers_url":"https://api.github.com/repos/gatsbyjs/gatsby/stargazers","contributors_url":"https://api.github.com/repos/gatsbyjs/gatsby/contributors","subscribers_url":"https://api.github.com/repos/gatsbyjs/gatsby/subscribers","subscription_url":"https://api.github.com/repos/gatsbyjs/gatsby/subscription","commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/commits{/sha}","git_commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/commits{/sha}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/comments{/number}","issue_comment_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments{/number}","contents_url":"https://api.github.com/repos/gatsbyjs/gatsby/contents/{+path}","compare_url":"https://api.github.com/repos/gatsbyjs/gatsby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gatsbyjs/gatsby/merges","archive_url":"https://api.github.com/repos/gatsbyjs/gatsby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gatsbyjs/gatsby/downloads","issues_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues{/number}","pulls_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls{/number}","milestones_url":"https://api.github.com/repos/gatsbyjs/gatsby/milestones{/number}","notifications_url":"https://api.github.com/repos/gatsbyjs/gatsby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/labels{/name}","releases_url":"https://api.github.com/repos/gatsbyjs/gatsby/releases{/id}","deployments_url":"https://api.github.com/repos/gatsbyjs/gatsby/deployments","created_at":"2015-05-21T22:43:05Z","updated_at":"2017-08-24T21:35:14Z","pushed_at":"2017-08-24T21:35:31Z","git_url":"git://github.com/gatsbyjs/gatsby.git","ssh_url":"git@github.com:gatsbyjs/gatsby.git","clone_url":"https://github.com/gatsbyjs/gatsby.git","svn_url":"https://github.com/gatsbyjs/gatsby","homepage":"https://www.gatsbyjs.org","size":140217,"stargazers_count":12690,"watchers_count":12690,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":812,"mirror_url":null,"open_issues_count":277,"forks":812,"open_issues":277,"watchers":12690,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907"},"html":{"href":"https://github.com/gatsbyjs/gatsby/pull/1907"},"issue":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1907"},"comments":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1907/comments"},"review_comments":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907/comments"},"review_comment":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1907/commits"},"statuses":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/277b8ac2e654b73e04a34482adbf54375c5d5d6a"}}}}
{"actor":{"display_login":"KyleAMathews"}}