{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/reticulum/pulls/comments/200545703","pull_request_review_id":134882993,"id":200545703,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDU0NTcwMw==","diff_hunk":"@@ -64,21 +66,24 @@ defmodule Ret.MediaResolver do\n       with client_id when is_binary(client_id) <- resolver_config(:deviantart_client_id),\n            client_secret when is_binary(client_secret) <-\n              resolver_config(:deviantart_client_secret) do\n-        page_resp = retry_get_until_success(uri |> URI.to_string())\n+        page_resp = uri |> URI.to_string() |> retry_get_until_success\n         deviant_id = Regex.run(@deviant_id_regex, page_resp.body) |> Enum.at(1)\n         token_host = \"https://www.deviantart.com/oauth2/token\"\n         api_host = \"https://www.deviantart.com/api/v1/oauth2\"\n \n-        token_url =\n+        token =\n           \"#{token_host}?client_id=#{client_id}&client_secret=#{client_secret}&grant_type=client_credentials\"\n-\n-        token_resp = retry_get_until_success(token_url)\n-        token = token_resp.body |> Poison.decode!() |> Kernel.get_in([\"access_token\"])\n-\n-        api_url = \"#{api_host}/deviation/#{deviant_id}?access_token=#{token}\"\n-        api_resp = retry_get_until_success(api_url)\n-\n-        api_resp.body |> Poison.decode!() |> Kernel.get_in([\"content\", \"src\"]) |> URI.parse()\n+          |> retry_get_until_success\n+          |> Map.get(:body)\n+          |> Poison.decode!()\n+          |> Map.get(\"access_token\")\n+\n+        \"#{api_host}/deviation/#{deviant_id}?access_token=#{token}\"\n+        |> retry_get_until_success\n+        |> Map.get(:body)\n+        |> Poison.decode!()\n+        |> Kernel.get_in([\"content\", \"src\"])\n+        |> URI.parse()","path":"lib/ret/media_resolver.ex","position":61,"original_position":61,"commit_id":"f68d0e4fceadbf29e7333883620937a53cd150df","original_commit_id":"f68d0e4fceadbf29e7333883620937a53cd150df","user":{"login":"gfodor","id":220020,"node_id":"MDQ6VXNlcjIyMDAyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/220020?v=4","gravatar_id":"","url":"https://api.github.com/users/gfodor","html_url":"https://github.com/gfodor","followers_url":"https://api.github.com/users/gfodor/followers","following_url":"https://api.github.com/users/gfodor/following{/other_user}","gists_url":"https://api.github.com/users/gfodor/gists{/gist_id}","starred_url":"https://api.github.com/users/gfodor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfodor/subscriptions","organizations_url":"https://api.github.com/users/gfodor/orgs","repos_url":"https://api.github.com/users/gfodor/repos","events_url":"https://api.github.com/users/gfodor/events{/privacy}","received_events_url":"https://api.github.com/users/gfodor/received_events","type":"User","site_admin":false},"body":"Haha I know crazy right :)","created_at":"2018-07-06T04:14:50Z","updated_at":"2018-07-06T04:14:50Z","html_url":"https://github.com/mozilla/reticulum/pull/44#discussion_r200545703","pull_request_url":"https://api.github.com/repos/mozilla/reticulum/pulls/44","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla/reticulum/pulls/comments/200545703"},"html":{"href":"https://github.com/mozilla/reticulum/pull/44#discussion_r200545703"},"pull_request":{"href":"https://api.github.com/repos/mozilla/reticulum/pulls/44"}},"in_reply_to_id":200543534},"pull_request":{"url":"https://api.github.com/repos/mozilla/reticulum/pulls/44","id":199623560,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjIzNTYw","html_url":"https://github.com/mozilla/reticulum/pull/44","diff_url":"https://github.com/mozilla/reticulum/pull/44.diff","patch_url":"https://github.com/mozilla/reticulum/pull/44.patch","issue_url":"https://api.github.com/repos/mozilla/reticulum/issues/44","number":44,"state":"open","locked":false,"title":"Remove some sites for now, refactor resolver","user":{"login":"gfodor","id":220020,"node_id":"MDQ6VXNlcjIyMDAyMA==","avatar_url":"https://avatars3.githubusercontent.com/u/220020?v=4","gravatar_id":"","url":"https://api.github.com/users/gfodor","html_url":"https://github.com/gfodor","followers_url":"https://api.github.com/users/gfodor/followers","following_url":"https://api.github.com/users/gfodor/following{/other_user}","gists_url":"https://api.github.com/users/gfodor/gists{/gist_id}","starred_url":"https://api.github.com/users/gfodor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfodor/subscriptions","organizations_url":"https://api.github.com/users/gfodor/orgs","repos_url":"https://api.github.com/users/gfodor/repos","events_url":"https://api.github.com/users/gfodor/events{/privacy}","received_events_url":"https://api.github.com/users/gfodor/received_events","type":"User","site_admin":false},"body":"Refactoring into pipelines, remove some ytdl sites for now.","created_at":"2018-07-06T01:27:08Z","updated_at":"2018-07-06T04:14:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f47056fbe505922da502773079a71fbb48ab1601","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/reticulum/pulls/44/commits","review_comments_url":"https://api.github.com/repos/mozilla/reticulum/pulls/44/comments","review_comment_url":"https://api.github.com/repos/mozilla/reticulum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/reticulum/issues/44/comments","statuses_url":"https://api.github.com/repos/mozilla/reticulum/statuses/f68d0e4fceadbf29e7333883620937a53cd150df","head":{"label":"mozilla:feature/poly-api-refactor","ref":"feature/poly-api-refactor","sha":"f68d0e4fceadbf29e7333883620937a53cd150df","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":105199856,"node_id":"MDEwOlJlcG9zaXRvcnkxMDUxOTk4NTY=","name":"reticulum","full_name":"mozilla/reticulum","owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/reticulum","description":"Phoenix web server for Social MR","fork":false,"url":"https://api.github.com/repos/mozilla/reticulum","forks_url":"https://api.github.com/repos/mozilla/reticulum/forks","keys_url":"https://api.github.com/repos/mozilla/reticulum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/reticulum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/reticulum/teams","hooks_url":"https://api.github.com/repos/mozilla/reticulum/hooks","issue_events_url":"https://api.github.com/repos/mozilla/reticulum/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/reticulum/events","assignees_url":"https://api.github.com/repos/mozilla/reticulum/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/reticulum/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/reticulum/tags","blobs_url":"https://api.github.com/repos/mozilla/reticulum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/reticulum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/reticulum/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/reticulum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/reticulum/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/reticulum/languages","stargazers_url":"https://api.github.com/repos/mozilla/reticulum/stargazers","contributors_url":"https://api.github.com/repos/mozilla/reticulum/contributors","subscribers_url":"https://api.github.com/repos/mozilla/reticulum/subscribers","subscription_url":"https://api.github.com/repos/mozilla/reticulum/subscription","commits_url":"https://api.github.com/repos/mozilla/reticulum/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/reticulum/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/reticulum/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/reticulum/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/reticulum/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/reticulum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/reticulum/merges","archive_url":"https://api.github.com/repos/mozilla/reticulum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/reticulum/downloads","issues_url":"https://api.github.com/repos/mozilla/reticulum/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/reticulum/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/reticulum/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/reticulum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/reticulum/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/reticulum/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/reticulum/deployments","created_at":"2017-09-28T21:13:09Z","updated_at":"2018-07-04T03:28:54Z","pushed_at":"2018-07-06T01:27:09Z","git_url":"git://github.com/mozilla/reticulum.git","ssh_url":"git@github.com:mozilla/reticulum.git","clone_url":"https://github.com/mozilla/reticulum.git","svn_url":"https://github.com/mozilla/reticulum","homepage":null,"size":1684,"stargazers_count":17,"watchers_count":17,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":4,"open_issues":12,"watchers":17,"default_branch":"master"}},"base":{"label":"mozilla:feature/poly-api","ref":"feature/poly-api","sha":"77715ab71ee9e666e77da3b62d54179a7e14e917","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":105199856,"node_id":"MDEwOlJlcG9zaXRvcnkxMDUxOTk4NTY=","name":"reticulum","full_name":"mozilla/reticulum","owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/reticulum","description":"Phoenix web server for Social MR","fork":false,"url":"https://api.github.com/repos/mozilla/reticulum","forks_url":"https://api.github.com/repos/mozilla/reticulum/forks","keys_url":"https://api.github.com/repos/mozilla/reticulum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/reticulum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/reticulum/teams","hooks_url":"https://api.github.com/repos/mozilla/reticulum/hooks","issue_events_url":"https://api.github.com/repos/mozilla/reticulum/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/reticulum/events","assignees_url":"https://api.github.com/repos/mozilla/reticulum/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/reticulum/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/reticulum/tags","blobs_url":"https://api.github.com/repos/mozilla/reticulum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/reticulum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/reticulum/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/reticulum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/reticulum/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/reticulum/languages","stargazers_url":"https://api.github.com/repos/mozilla/reticulum/stargazers","contributors_url":"https://api.github.com/repos/mozilla/reticulum/contributors","subscribers_url":"https://api.github.com/repos/mozilla/reticulum/subscribers","subscription_url":"https://api.github.com/repos/mozilla/reticulum/subscription","commits_url":"https://api.github.com/repos/mozilla/reticulum/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/reticulum/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/reticulum/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/reticulum/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/reticulum/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/reticulum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/reticulum/merges","archive_url":"https://api.github.com/repos/mozilla/reticulum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/reticulum/downloads","issues_url":"https://api.github.com/repos/mozilla/reticulum/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/reticulum/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/reticulum/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/reticulum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/reticulum/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/reticulum/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/reticulum/deployments","created_at":"2017-09-28T21:13:09Z","updated_at":"2018-07-04T03:28:54Z","pushed_at":"2018-07-06T01:27:09Z","git_url":"git://github.com/mozilla/reticulum.git","ssh_url":"git@github.com:mozilla/reticulum.git","clone_url":"https://github.com/mozilla/reticulum.git","svn_url":"https://github.com/mozilla/reticulum","homepage":null,"size":1684,"stargazers_count":17,"watchers_count":17,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":4,"open_issues":12,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/reticulum/pulls/44"},"html":{"href":"https://github.com/mozilla/reticulum/pull/44"},"issue":{"href":"https://api.github.com/repos/mozilla/reticulum/issues/44"},"comments":{"href":"https://api.github.com/repos/mozilla/reticulum/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/reticulum/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/reticulum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/reticulum/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/reticulum/statuses/f68d0e4fceadbf29e7333883620937a53cd150df"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"gfodor"}}