{"action":"created","comment":{"url":"https://api.github.com/repos/spion/howdoi-node/pulls/comments/22791139","id":22791139,"diff_hunk":"@@ -47,42 +67,43 @@ request(url, function(e, r, body) {\n         links = $(links_selector).map(function(i, el) { return el.attribs.href; });\n     \n     if (!args.code && args.links) for (var k = 0; k < res && links[k]; ++k) {\n-        console.log(\"#\" + (k+1), links[k]);\n+        aLog(aLink(\"#\" + (k+1)), aLink(links[k]));\n     }\n     if (!links[res]) {\n-        console.log(\"No more results\");\n+        aLog(aError(\"No results found\"));\n     }\n     else request(links[args.result - 1], function(e, r, body) {\n         var $ = cheerio.load(body);\n         var answers = $('.answer .post-text').map(function(i, el) {\n             if (args.code) {\n-                return $(el).find('pre').text();\n+                return aCode($(el).find('pre').text());\n             }\n-            return $(el).text();\n+            var code = $(el).find('pre').text();\n+            return $(el).text().replace(code, aCode(code));","path":"howdoi.js","position":63,"original_position":63,"commit_id":"167af378398e1b528afb1d2a84e4e5198e0f3a45","original_commit_id":"167af378398e1b528afb1d2a84e4e5198e0f3a45","user":{"login":"spion","id":502412,"avatar_url":"https://avatars.githubusercontent.com/u/502412?v=3","gravatar_id":"","url":"https://api.github.com/users/spion","html_url":"https://github.com/spion","followers_url":"https://api.github.com/users/spion/followers","following_url":"https://api.github.com/users/spion/following{/other_user}","gists_url":"https://api.github.com/users/spion/gists{/gist_id}","starred_url":"https://api.github.com/users/spion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion/subscriptions","organizations_url":"https://api.github.com/users/spion/orgs","repos_url":"https://api.github.com/users/spion/repos","events_url":"https://api.github.com/users/spion/events{/privacy}","received_events_url":"https://api.github.com/users/spion/received_events","type":"User","site_admin":false},"body":"this is going to be harder because some SO answers have multiple blocks of code","created_at":"2015-01-12T14:05:30Z","updated_at":"2015-01-12T14:05:30Z","html_url":"https://github.com/spion/howdoi-node/pull/3#discussion_r22791139","pull_request_url":"https://api.github.com/repos/spion/howdoi-node/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/spion/howdoi-node/pulls/comments/22791139"},"html":{"href":"https://github.com/spion/howdoi-node/pull/3#discussion_r22791139"},"pull_request":{"href":"https://api.github.com/repos/spion/howdoi-node/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/spion/howdoi-node/pulls/3","id":27194817,"html_url":"https://github.com/spion/howdoi-node/pull/3","diff_url":"https://github.com/spion/howdoi-node/pull/3.diff","patch_url":"https://github.com/spion/howdoi-node/pull/3.patch","issue_url":"https://api.github.com/repos/spion/howdoi-node/issues/3","number":3,"state":"open","locked":false,"title":"Added color support","user":{"login":"Bigous","id":6886560,"avatar_url":"https://avatars.githubusercontent.com/u/6886560?v=3","gravatar_id":"","url":"https://api.github.com/users/Bigous","html_url":"https://github.com/Bigous","followers_url":"https://api.github.com/users/Bigous/followers","following_url":"https://api.github.com/users/Bigous/following{/other_user}","gists_url":"https://api.github.com/users/Bigous/gists{/gist_id}","starred_url":"https://api.github.com/users/Bigous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bigous/subscriptions","organizations_url":"https://api.github.com/users/Bigous/orgs","repos_url":"https://api.github.com/users/Bigous/repos","events_url":"https://api.github.com/users/Bigous/events{/privacy}","received_events_url":"https://api.github.com/users/Bigous/received_events","type":"User","site_admin":false},"body":"Added color suport thru cli-color","created_at":"2015-01-12T13:49:10Z","updated_at":"2015-01-12T14:05:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spion/howdoi-node/pulls/3/commits","review_comments_url":"https://api.github.com/repos/spion/howdoi-node/pulls/3/comments","review_comment_url":"https://api.github.com/repos/spion/howdoi-node/pulls/comments/{number}","comments_url":"https://api.github.com/repos/spion/howdoi-node/issues/3/comments","statuses_url":"https://api.github.com/repos/spion/howdoi-node/statuses/167af378398e1b528afb1d2a84e4e5198e0f3a45","head":{"label":"Bigous:master","ref":"master","sha":"167af378398e1b528afb1d2a84e4e5198e0f3a45","user":{"login":"Bigous","id":6886560,"avatar_url":"https://avatars.githubusercontent.com/u/6886560?v=3","gravatar_id":"","url":"https://api.github.com/users/Bigous","html_url":"https://github.com/Bigous","followers_url":"https://api.github.com/users/Bigous/followers","following_url":"https://api.github.com/users/Bigous/following{/other_user}","gists_url":"https://api.github.com/users/Bigous/gists{/gist_id}","starred_url":"https://api.github.com/users/Bigous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bigous/subscriptions","organizations_url":"https://api.github.com/users/Bigous/orgs","repos_url":"https://api.github.com/users/Bigous/repos","events_url":"https://api.github.com/users/Bigous/events{/privacy}","received_events_url":"https://api.github.com/users/Bigous/received_events","type":"User","site_admin":false},"repo":{"id":29132733,"name":"howdoi-node","full_name":"Bigous/howdoi-node","owner":{"login":"Bigous","id":6886560,"avatar_url":"https://avatars.githubusercontent.com/u/6886560?v=3","gravatar_id":"","url":"https://api.github.com/users/Bigous","html_url":"https://github.com/Bigous","followers_url":"https://api.github.com/users/Bigous/followers","following_url":"https://api.github.com/users/Bigous/following{/other_user}","gists_url":"https://api.github.com/users/Bigous/gists{/gist_id}","starred_url":"https://api.github.com/users/Bigous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bigous/subscriptions","organizations_url":"https://api.github.com/users/Bigous/orgs","repos_url":"https://api.github.com/users/Bigous/repos","events_url":"https://api.github.com/users/Bigous/events{/privacy}","received_events_url":"https://api.github.com/users/Bigous/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bigous/howdoi-node","description":"A howdoi implementation for node with more options and better text display (thanks to cheerio)","fork":true,"url":"https://api.github.com/repos/Bigous/howdoi-node","forks_url":"https://api.github.com/repos/Bigous/howdoi-node/forks","keys_url":"https://api.github.com/repos/Bigous/howdoi-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bigous/howdoi-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bigous/howdoi-node/teams","hooks_url":"https://api.github.com/repos/Bigous/howdoi-node/hooks","issue_events_url":"https://api.github.com/repos/Bigous/howdoi-node/issues/events{/number}","events_url":"https://api.github.com/repos/Bigous/howdoi-node/events","assignees_url":"https://api.github.com/repos/Bigous/howdoi-node/assignees{/user}","branches_url":"https://api.github.com/repos/Bigous/howdoi-node/branches{/branch}","tags_url":"https://api.github.com/repos/Bigous/howdoi-node/tags","blobs_url":"https://api.github.com/repos/Bigous/howdoi-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bigous/howdoi-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bigous/howdoi-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bigous/howdoi-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bigous/howdoi-node/statuses/{sha}","languages_url":"https://api.github.com/repos/Bigous/howdoi-node/languages","stargazers_url":"https://api.github.com/repos/Bigous/howdoi-node/stargazers","contributors_url":"https://api.github.com/repos/Bigous/howdoi-node/contributors","subscribers_url":"https://api.github.com/repos/Bigous/howdoi-node/subscribers","subscription_url":"https://api.github.com/repos/Bigous/howdoi-node/subscription","commits_url":"https://api.github.com/repos/Bigous/howdoi-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bigous/howdoi-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bigous/howdoi-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bigous/howdoi-node/issues/comments/{number}","contents_url":"https://api.github.com/repos/Bigous/howdoi-node/contents/{+path}","compare_url":"https://api.github.com/repos/Bigous/howdoi-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bigous/howdoi-node/merges","archive_url":"https://api.github.com/repos/Bigous/howdoi-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bigous/howdoi-node/downloads","issues_url":"https://api.github.com/repos/Bigous/howdoi-node/issues{/number}","pulls_url":"https://api.github.com/repos/Bigous/howdoi-node/pulls{/number}","milestones_url":"https://api.github.com/repos/Bigous/howdoi-node/milestones{/number}","notifications_url":"https://api.github.com/repos/Bigous/howdoi-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bigous/howdoi-node/labels{/name}","releases_url":"https://api.github.com/repos/Bigous/howdoi-node/releases{/id}","created_at":"2015-01-12T11:38:33Z","updated_at":"2015-01-12T13:57:05Z","pushed_at":"2015-01-12T13:57:05Z","git_url":"git://github.com/Bigous/howdoi-node.git","ssh_url":"git@github.com:Bigous/howdoi-node.git","clone_url":"https://github.com/Bigous/howdoi-node.git","svn_url":"https://github.com/Bigous/howdoi-node","homepage":null,"size":98,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":"spion:master","ref":"master","sha":"934fc77b3a90b7e1b896a5efe28e4181047dff0c","user":{"login":"spion","id":502412,"avatar_url":"https://avatars.githubusercontent.com/u/502412?v=3","gravatar_id":"","url":"https://api.github.com/users/spion","html_url":"https://github.com/spion","followers_url":"https://api.github.com/users/spion/followers","following_url":"https://api.github.com/users/spion/following{/other_user}","gists_url":"https://api.github.com/users/spion/gists{/gist_id}","starred_url":"https://api.github.com/users/spion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion/subscriptions","organizations_url":"https://api.github.com/users/spion/orgs","repos_url":"https://api.github.com/users/spion/repos","events_url":"https://api.github.com/users/spion/events{/privacy}","received_events_url":"https://api.github.com/users/spion/received_events","type":"User","site_admin":false},"repo":{"id":7530286,"name":"howdoi-node","full_name":"spion/howdoi-node","owner":{"login":"spion","id":502412,"avatar_url":"https://avatars.githubusercontent.com/u/502412?v=3","gravatar_id":"","url":"https://api.github.com/users/spion","html_url":"https://github.com/spion","followers_url":"https://api.github.com/users/spion/followers","following_url":"https://api.github.com/users/spion/following{/other_user}","gists_url":"https://api.github.com/users/spion/gists{/gist_id}","starred_url":"https://api.github.com/users/spion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion/subscriptions","organizations_url":"https://api.github.com/users/spion/orgs","repos_url":"https://api.github.com/users/spion/repos","events_url":"https://api.github.com/users/spion/events{/privacy}","received_events_url":"https://api.github.com/users/spion/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spion/howdoi-node","description":"A howdoi implementation for node with more options and better text display (thanks to cheerio)","fork":false,"url":"https://api.github.com/repos/spion/howdoi-node","forks_url":"https://api.github.com/repos/spion/howdoi-node/forks","keys_url":"https://api.github.com/repos/spion/howdoi-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spion/howdoi-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spion/howdoi-node/teams","hooks_url":"https://api.github.com/repos/spion/howdoi-node/hooks","issue_events_url":"https://api.github.com/repos/spion/howdoi-node/issues/events{/number}","events_url":"https://api.github.com/repos/spion/howdoi-node/events","assignees_url":"https://api.github.com/repos/spion/howdoi-node/assignees{/user}","branches_url":"https://api.github.com/repos/spion/howdoi-node/branches{/branch}","tags_url":"https://api.github.com/repos/spion/howdoi-node/tags","blobs_url":"https://api.github.com/repos/spion/howdoi-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spion/howdoi-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spion/howdoi-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/spion/howdoi-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spion/howdoi-node/statuses/{sha}","languages_url":"https://api.github.com/repos/spion/howdoi-node/languages","stargazers_url":"https://api.github.com/repos/spion/howdoi-node/stargazers","contributors_url":"https://api.github.com/repos/spion/howdoi-node/contributors","subscribers_url":"https://api.github.com/repos/spion/howdoi-node/subscribers","subscription_url":"https://api.github.com/repos/spion/howdoi-node/subscription","commits_url":"https://api.github.com/repos/spion/howdoi-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/spion/howdoi-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/spion/howdoi-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/spion/howdoi-node/issues/comments/{number}","contents_url":"https://api.github.com/repos/spion/howdoi-node/contents/{+path}","compare_url":"https://api.github.com/repos/spion/howdoi-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spion/howdoi-node/merges","archive_url":"https://api.github.com/repos/spion/howdoi-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spion/howdoi-node/downloads","issues_url":"https://api.github.com/repos/spion/howdoi-node/issues{/number}","pulls_url":"https://api.github.com/repos/spion/howdoi-node/pulls{/number}","milestones_url":"https://api.github.com/repos/spion/howdoi-node/milestones{/number}","notifications_url":"https://api.github.com/repos/spion/howdoi-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spion/howdoi-node/labels{/name}","releases_url":"https://api.github.com/repos/spion/howdoi-node/releases{/id}","created_at":"2013-01-09T22:32:18Z","updated_at":"2015-01-12T12:52:02Z","pushed_at":"2015-01-12T12:52:01Z","git_url":"git://github.com/spion/howdoi-node.git","ssh_url":"git@github.com:spion/howdoi-node.git","clone_url":"https://github.com/spion/howdoi-node.git","svn_url":"https://github.com/spion/howdoi-node","homepage":null,"size":112,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spion/howdoi-node/pulls/3"},"html":{"href":"https://github.com/spion/howdoi-node/pull/3"},"issue":{"href":"https://api.github.com/repos/spion/howdoi-node/issues/3"},"comments":{"href":"https://api.github.com/repos/spion/howdoi-node/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/spion/howdoi-node/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/spion/howdoi-node/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/spion/howdoi-node/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/spion/howdoi-node/statuses/167af378398e1b528afb1d2a84e4e5198e0f3a45"}}}}