{"action":"opened","number":303,"pull_request":{"url":"https://api.github.com/repos/discourse/onebox/pulls/303","id":37644024,"html_url":"https://github.com/discourse/onebox/pull/303","diff_url":"https://github.com/discourse/onebox/pull/303.diff","patch_url":"https://github.com/discourse/onebox/pull/303.patch","issue_url":"https://api.github.com/repos/discourse/onebox/issues/303","number":303,"state":"open","locked":false,"title":"Adding Onebox#check method, solving #154","user":{"login":"Gargron","id":184731,"avatar_url":"https://avatars.githubusercontent.com/u/184731?v=3","gravatar_id":"","url":"https://api.github.com/users/Gargron","html_url":"https://github.com/Gargron","followers_url":"https://api.github.com/users/Gargron/followers","following_url":"https://api.github.com/users/Gargron/following{/other_user}","gists_url":"https://api.github.com/users/Gargron/gists{/gist_id}","starred_url":"https://api.github.com/users/Gargron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gargron/subscriptions","organizations_url":"https://api.github.com/users/Gargron/orgs","repos_url":"https://api.github.com/users/Gargron/repos","events_url":"https://api.github.com/users/Gargron/events{/privacy}","received_events_url":"https://api.github.com/users/Gargron/received_events","type":"User","site_admin":false},"body":"It returns a `Onebox::StatusCheck` instance that exposes the methods\r\n`human_status` and `ok?`, wherein `human_status` returns symbols like\r\n`:success` and `ok?` returns true if and only if the HTTP status code\r\nlies between 200 and 299.\r\n\r\nThe status symbols follow the broad Rails terminology for status ranges (see <http://teamco-anthill.blogspot.co.uk/2010/04/rails-http-status-code-to-symbol.html>), so that would be:\r\n\r\n- `:success` for 200-299\r\n- `:client_error` for 400-499\r\n- `:server_error` for 500-599\r\n- `:unknown_error` for all other HTTP status codes\r\n- `:connection_error` on timeouts, socket issues, etc\r\n\r\n","created_at":"2015-06-14T16:19:19Z","updated_at":"2015-06-14T16:19:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/discourse/onebox/pulls/303/commits","review_comments_url":"https://api.github.com/repos/discourse/onebox/pulls/303/comments","review_comment_url":"https://api.github.com/repos/discourse/onebox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/discourse/onebox/issues/303/comments","statuses_url":"https://api.github.com/repos/discourse/onebox/statuses/9f72e10ea5664f3059a50707f9692fce27a37803","head":{"label":"Gargron:issue-154","ref":"issue-154","sha":"9f72e10ea5664f3059a50707f9692fce27a37803","user":{"login":"Gargron","id":184731,"avatar_url":"https://avatars.githubusercontent.com/u/184731?v=3","gravatar_id":"","url":"https://api.github.com/users/Gargron","html_url":"https://github.com/Gargron","followers_url":"https://api.github.com/users/Gargron/followers","following_url":"https://api.github.com/users/Gargron/following{/other_user}","gists_url":"https://api.github.com/users/Gargron/gists{/gist_id}","starred_url":"https://api.github.com/users/Gargron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gargron/subscriptions","organizations_url":"https://api.github.com/users/Gargron/orgs","repos_url":"https://api.github.com/users/Gargron/repos","events_url":"https://api.github.com/users/Gargron/events{/privacy}","received_events_url":"https://api.github.com/users/Gargron/received_events","type":"User","site_admin":false},"repo":{"id":37417165,"name":"onebox","full_name":"Gargron/onebox","owner":{"login":"Gargron","id":184731,"avatar_url":"https://avatars.githubusercontent.com/u/184731?v=3","gravatar_id":"","url":"https://api.github.com/users/Gargron","html_url":"https://github.com/Gargron","followers_url":"https://api.github.com/users/Gargron/followers","following_url":"https://api.github.com/users/Gargron/following{/other_user}","gists_url":"https://api.github.com/users/Gargron/gists{/gist_id}","starred_url":"https://api.github.com/users/Gargron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gargron/subscriptions","organizations_url":"https://api.github.com/users/Gargron/orgs","repos_url":"https://api.github.com/users/Gargron/repos","events_url":"https://api.github.com/users/Gargron/events{/privacy}","received_events_url":"https://api.github.com/users/Gargron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gargron/onebox","description":"A gem for turning URLs into website previews","fork":true,"url":"https://api.github.com/repos/Gargron/onebox","forks_url":"https://api.github.com/repos/Gargron/onebox/forks","keys_url":"https://api.github.com/repos/Gargron/onebox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gargron/onebox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gargron/onebox/teams","hooks_url":"https://api.github.com/repos/Gargron/onebox/hooks","issue_events_url":"https://api.github.com/repos/Gargron/onebox/issues/events{/number}","events_url":"https://api.github.com/repos/Gargron/onebox/events","assignees_url":"https://api.github.com/repos/Gargron/onebox/assignees{/user}","branches_url":"https://api.github.com/repos/Gargron/onebox/branches{/branch}","tags_url":"https://api.github.com/repos/Gargron/onebox/tags","blobs_url":"https://api.github.com/repos/Gargron/onebox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gargron/onebox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gargron/onebox/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gargron/onebox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gargron/onebox/statuses/{sha}","languages_url":"https://api.github.com/repos/Gargron/onebox/languages","stargazers_url":"https://api.github.com/repos/Gargron/onebox/stargazers","contributors_url":"https://api.github.com/repos/Gargron/onebox/contributors","subscribers_url":"https://api.github.com/repos/Gargron/onebox/subscribers","subscription_url":"https://api.github.com/repos/Gargron/onebox/subscription","commits_url":"https://api.github.com/repos/Gargron/onebox/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gargron/onebox/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gargron/onebox/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gargron/onebox/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gargron/onebox/contents/{+path}","compare_url":"https://api.github.com/repos/Gargron/onebox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gargron/onebox/merges","archive_url":"https://api.github.com/repos/Gargron/onebox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gargron/onebox/downloads","issues_url":"https://api.github.com/repos/Gargron/onebox/issues{/number}","pulls_url":"https://api.github.com/repos/Gargron/onebox/pulls{/number}","milestones_url":"https://api.github.com/repos/Gargron/onebox/milestones{/number}","notifications_url":"https://api.github.com/repos/Gargron/onebox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gargron/onebox/labels{/name}","releases_url":"https://api.github.com/repos/Gargron/onebox/releases{/id}","created_at":"2015-06-14T15:14:14Z","updated_at":"2015-06-14T15:14:15Z","pushed_at":"2015-06-14T16:15:41Z","git_url":"git://github.com/Gargron/onebox.git","ssh_url":"git@github.com:Gargron/onebox.git","clone_url":"https://github.com/Gargron/onebox.git","svn_url":"https://github.com/Gargron/onebox","homepage":"https://github.com/discourse/onebox","size":5930,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"discourse:master","ref":"master","sha":"d5bf777449b639fcbf41f693e995d3533b6bf108","user":{"login":"discourse","id":3220138,"avatar_url":"https://avatars.githubusercontent.com/u/3220138?v=3","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"repo":{"id":11273069,"name":"onebox","full_name":"discourse/onebox","owner":{"login":"discourse","id":3220138,"avatar_url":"https://avatars.githubusercontent.com/u/3220138?v=3","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/discourse/onebox","description":"A gem for turning URLs into website previews","fork":false,"url":"https://api.github.com/repos/discourse/onebox","forks_url":"https://api.github.com/repos/discourse/onebox/forks","keys_url":"https://api.github.com/repos/discourse/onebox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discourse/onebox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discourse/onebox/teams","hooks_url":"https://api.github.com/repos/discourse/onebox/hooks","issue_events_url":"https://api.github.com/repos/discourse/onebox/issues/events{/number}","events_url":"https://api.github.com/repos/discourse/onebox/events","assignees_url":"https://api.github.com/repos/discourse/onebox/assignees{/user}","branches_url":"https://api.github.com/repos/discourse/onebox/branches{/branch}","tags_url":"https://api.github.com/repos/discourse/onebox/tags","blobs_url":"https://api.github.com/repos/discourse/onebox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discourse/onebox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discourse/onebox/git/refs{/sha}","trees_url":"https://api.github.com/repos/discourse/onebox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discourse/onebox/statuses/{sha}","languages_url":"https://api.github.com/repos/discourse/onebox/languages","stargazers_url":"https://api.github.com/repos/discourse/onebox/stargazers","contributors_url":"https://api.github.com/repos/discourse/onebox/contributors","subscribers_url":"https://api.github.com/repos/discourse/onebox/subscribers","subscription_url":"https://api.github.com/repos/discourse/onebox/subscription","commits_url":"https://api.github.com/repos/discourse/onebox/commits{/sha}","git_commits_url":"https://api.github.com/repos/discourse/onebox/git/commits{/sha}","comments_url":"https://api.github.com/repos/discourse/onebox/comments{/number}","issue_comment_url":"https://api.github.com/repos/discourse/onebox/issues/comments{/number}","contents_url":"https://api.github.com/repos/discourse/onebox/contents/{+path}","compare_url":"https://api.github.com/repos/discourse/onebox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discourse/onebox/merges","archive_url":"https://api.github.com/repos/discourse/onebox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discourse/onebox/downloads","issues_url":"https://api.github.com/repos/discourse/onebox/issues{/number}","pulls_url":"https://api.github.com/repos/discourse/onebox/pulls{/number}","milestones_url":"https://api.github.com/repos/discourse/onebox/milestones{/number}","notifications_url":"https://api.github.com/repos/discourse/onebox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discourse/onebox/labels{/name}","releases_url":"https://api.github.com/repos/discourse/onebox/releases{/id}","created_at":"2013-07-09T04:44:38Z","updated_at":"2015-06-14T15:06:08Z","pushed_at":"2015-06-14T16:19:19Z","git_url":"git://github.com/discourse/onebox.git","ssh_url":"git@github.com:discourse/onebox.git","clone_url":"https://github.com/discourse/onebox.git","svn_url":"https://github.com/discourse/onebox","homepage":"https://github.com/discourse/onebox","size":5930,"stargazers_count":286,"watchers_count":286,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":34,"forks":67,"open_issues":34,"watchers":286,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/discourse/onebox/pulls/303"},"html":{"href":"https://github.com/discourse/onebox/pull/303"},"issue":{"href":"https://api.github.com/repos/discourse/onebox/issues/303"},"comments":{"href":"https://api.github.com/repos/discourse/onebox/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/discourse/onebox/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/discourse/onebox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/discourse/onebox/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/discourse/onebox/statuses/9f72e10ea5664f3059a50707f9692fce27a37803"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":117,"deletions":0,"changed_files":3}}