{"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments/29825337","id":29825337,"diff_hunk":"@@ -0,0 +1,37 @@\n+package DDG::Goodie::OnionAddress;\n+# ABSTRACT: Provide quick access to HTTP onion services.\n+\n+use strict;\n+use DDG::Goodie;\n+\n+zci is_cached => 1;\n+zci answer_type => \"onion_address\";\n+\n+primary_example_queries '3g2upl4pq6kufc4m.onion';\n+secondary_example_queries 'How do I access https://3g2upl4pq6kufc4m.onion:81/?q=dont+track+us?';\n+description 'Provide quick access to HTTP onion services';\n+name 'OnionAddress';\n+code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/OnionAddress.pm';\n+category 'reference';\n+topics 'special_interest', 'cryptography';\n+attribution email => 'ilv@torproject.org';\n+\n+# regex to detect an onion address\n+# this cover several cases, including addresses with ports and/or paths\n+# e.g. https://3g2upl4pq6kufc4m.onion:5000/?q=dont+track+us\n+my $onion_address_qr = qr/(\\w+:\\/\\/)?([a-z0-9]{16})\\.onion(:\\d+)?(\\/.*)?/;\n+\n+# add an optional question mark in case it's at the end of a question sentence\n+# e.g. How do I access https://0123456789abcdef.onion?\n+triggers query_lc => qr/\\b$onion_address_qr(\\?)?\\b/;\n+\n+handle query_lc => sub {\n+\n+    # we only accept queries for web onion services\n+    # we also assume that an onion service without protocol:// should be web\n+    return unless !$1 or $1 eq 'https://' or $1 eq 'http://' or $2;\n+    return $2, html => \"<div class='zci__caption'>Access $2.onion using the <a href='https://www.torproject.org/projects/torbrowser.html.en'>Tor Browser</a> or via <a href='https://$2.tor2web.org'>Tor2web</a>.</div>\";","path":"lib/DDG/Goodie/OnionAddress.pm","position":33,"original_position":33,"commit_id":"90a94b22923c4bd7311f9ed5c9f979b277ceebf0","original_commit_id":"90a94b22923c4bd7311f9ed5c9f979b277ceebf0","user":{"login":"ilv","id":1916953,"avatar_url":"https://avatars.githubusercontent.com/u/1916953?v=3","gravatar_id":"","url":"https://api.github.com/users/ilv","html_url":"https://github.com/ilv","followers_url":"https://api.github.com/users/ilv/followers","following_url":"https://api.github.com/users/ilv/following{/other_user}","gists_url":"https://api.github.com/users/ilv/gists{/gist_id}","starred_url":"https://api.github.com/users/ilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilv/subscriptions","organizations_url":"https://api.github.com/users/ilv/orgs","repos_url":"https://api.github.com/users/ilv/repos","events_url":"https://api.github.com/users/ilv/events{/privacy}","received_events_url":"https://api.github.com/users/ilv/received_events","type":"User","site_admin":false},"body":"Alright, I'll take a look at this during the weekend, thanks.","created_at":"2015-05-07T05:25:37Z","updated_at":"2015-05-07T05:25:37Z","html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1040#discussion_r29825337","pull_request_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments/29825337"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1040#discussion_r29825337"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040","id":30528763,"html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1040","diff_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1040.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1040.patch","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1040","number":1040,"state":"open","locked":false,"title":"New IA idea for onion addresses","user":{"login":"ilv","id":1916953,"avatar_url":"https://avatars.githubusercontent.com/u/1916953?v=3","gravatar_id":"","url":"https://api.github.com/users/ilv","html_url":"https://github.com/ilv","followers_url":"https://api.github.com/users/ilv/followers","following_url":"https://api.github.com/users/ilv/following{/other_user}","gists_url":"https://api.github.com/users/ilv/gists{/gist_id}","starred_url":"https://api.github.com/users/ilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilv/subscriptions","organizations_url":"https://api.github.com/users/ilv/orgs","repos_url":"https://api.github.com/users/ilv/repos","events_url":"https://api.github.com/users/ilv/events{/privacy}","received_events_url":"https://api.github.com/users/ilv/received_events","type":"User","site_admin":false},"body":"What does your Instant Answer do?\r\nDetect when someone searchs an onion address that refers to an HTTP onion/hidden service and provide quick links to access it. \r\n\r\nWhat problem does your Instant Answer solve (Why is it better than organic links)?\r\nIt provide quick links to access HTTP onion/hidden services. Normally, it would take several clicks to find how to access .onion addresses if you are not familiar with it.\r\n\r\nWhat are some example queries that trigger this Instant Answer?\r\nExample 1: https://3g2upl4pq6kufc4m.onion\r\nExample 2: How do I access https://3g2upl4pq6kufc4m.onion/?\r\nExample 3: What is https://3g2upl4pq6kufc4m.onion:5000/?q=dont+track+us?\r\n\r\nWhich communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)\r\nPeople interested in privacy, freedom of speech, anti-censorship, whistleblowing.\r\n\r\nIs this Instant Answer connected to a DuckDuckHack Instant Answer idea?\r\nNope.\r\n\r\n\r\nWhat does the Instant Answer look like? (Provide a screenshot for new or updated Instant Answers)\r\n![ddg_onion_address_ia](https://cloud.githubusercontent.com/assets/1916953/6499071/ae1dcfec-c2d3-11e4-8929-81a0cd968f62.png)\r\n\r\n\r\nChecklist\r\n\r\nPlease place an 'X' where appropriate.\r\n\r\n- [X] Added metadata and attribution information (https://duck.co/duckduckhack/metadata)\r\n- [X] Wrote test file and added to t/ directory (https://duck.co/duckduckhack/goodie_tests)\r\n- [X] Verified that instant answer adheres to design guidelines (https://duck.co/duckduckhack/design_styleguide)\r\n- [X] Verified that instant answer adheres to code styleguide (https://duck.co/duckduckhack/code_styleguide)\r\n- [] Tested cross-browser compatibility\r\n\r\n    Please let us know which browsers/devices you've tested on:\r\n    - So far I've only tested it on the Virtual Box virtual machine provided for development.\r\n\r\n**Note**: The proposed IA provides a link to visit an HTTP onion service via Tor2web. It seems that for the moment this service is not working properly, so it's possible you won't be able to access the examples via Tor2web.","created_at":"2015-03-05T04:04:53Z","updated_at":"2015-05-07T05:25:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8d80a69c985f669e98f89a6081e55f38a3cad5b","assignee":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=3","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1040/comments","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/90a94b22923c4bd7311f9ed5c9f979b277ceebf0","head":{"label":"ilv:master","ref":"master","sha":"90a94b22923c4bd7311f9ed5c9f979b277ceebf0","user":{"login":"ilv","id":1916953,"avatar_url":"https://avatars.githubusercontent.com/u/1916953?v=3","gravatar_id":"","url":"https://api.github.com/users/ilv","html_url":"https://github.com/ilv","followers_url":"https://api.github.com/users/ilv/followers","following_url":"https://api.github.com/users/ilv/following{/other_user}","gists_url":"https://api.github.com/users/ilv/gists{/gist_id}","starred_url":"https://api.github.com/users/ilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilv/subscriptions","organizations_url":"https://api.github.com/users/ilv/orgs","repos_url":"https://api.github.com/users/ilv/repos","events_url":"https://api.github.com/users/ilv/events{/privacy}","received_events_url":"https://api.github.com/users/ilv/received_events","type":"User","site_admin":false},"repo":{"id":31296962,"name":"zeroclickinfo-goodies","full_name":"ilv/zeroclickinfo-goodies","owner":{"login":"ilv","id":1916953,"avatar_url":"https://avatars.githubusercontent.com/u/1916953?v=3","gravatar_id":"","url":"https://api.github.com/users/ilv","html_url":"https://github.com/ilv","followers_url":"https://api.github.com/users/ilv/followers","following_url":"https://api.github.com/users/ilv/following{/other_user}","gists_url":"https://api.github.com/users/ilv/gists{/gist_id}","starred_url":"https://api.github.com/users/ilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilv/subscriptions","organizations_url":"https://api.github.com/users/ilv/orgs","repos_url":"https://api.github.com/users/ilv/repos","events_url":"https://api.github.com/users/ilv/events{/privacy}","received_events_url":"https://api.github.com/users/ilv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilv/zeroclickinfo-goodies","description":"DuckDuckGo instant answer plugins based on Perl functions","fork":true,"url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies","forks_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/forks","keys_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/teams","hooks_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/hooks","issue_events_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/issues/events{/number}","events_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/events","assignees_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/assignees{/user}","branches_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/branches{/branch}","tags_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/tags","blobs_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/statuses/{sha}","languages_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/languages","stargazers_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/stargazers","contributors_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/contributors","subscribers_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/subscribers","subscription_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/subscription","commits_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/contents/{+path}","compare_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/merges","archive_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/downloads","issues_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/issues{/number}","pulls_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/pulls{/number}","milestones_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/milestones{/number}","notifications_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/labels{/name}","releases_url":"https://api.github.com/repos/ilv/zeroclickinfo-goodies/releases{/id}","created_at":"2015-02-25T04:23:18Z","updated_at":"2015-03-06T19:27:58Z","pushed_at":"2015-03-17T18:18:37Z","git_url":"git://github.com/ilv/zeroclickinfo-goodies.git","ssh_url":"git@github.com:ilv/zeroclickinfo-goodies.git","clone_url":"https://github.com/ilv/zeroclickinfo-goodies.git","svn_url":"https://github.com/ilv/zeroclickinfo-goodies","homepage":"http://duckduckhack.com/","size":9349,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"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":"duckduckgo:master","ref":"master","sha":"01fb8cac4a4edf9961b3bd401f90e9315d9c953a","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":2164979,"name":"zeroclickinfo-goodies","full_name":"duckduckgo/zeroclickinfo-goodies","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies","description":"DuckDuckGo instant answer plugins based on Perl functions","fork":false,"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies","forks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/forks","keys_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/teams","hooks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/events","assignees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/tags","blobs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/subscription","commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/merges","archive_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/downloads","issues_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/releases{/id}","created_at":"2011-08-06T13:26:05Z","updated_at":"2015-05-06T14:59:06Z","pushed_at":"2015-05-07T01:44:46Z","git_url":"git://github.com/duckduckgo/zeroclickinfo-goodies.git","ssh_url":"git@github.com:duckduckgo/zeroclickinfo-goodies.git","clone_url":"https://github.com/duckduckgo/zeroclickinfo-goodies.git","svn_url":"https://github.com/duckduckgo/zeroclickinfo-goodies","homepage":"http://duckduckhack.com/","size":29629,"stargazers_count":266,"watchers_count":266,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":783,"mirror_url":null,"open_issues_count":92,"forks":783,"open_issues":92,"watchers":266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1040"},"issue":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1040"},"comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1040/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1040/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/90a94b22923c4bd7311f9ed5c9f979b277ceebf0"}}}}