{"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/comments/85413857","pull_request_review_id":6133016,"id":85413857,"diff_hunk":"@@ -0,0 +1,178 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+\n+import os\n+from bs4 import BeautifulSoup\n+\n+URL_ROOT = 'http://flask.pocoo.org/docs/0.11/'\n+DOWNLOADED_HTML_PATH = 'download/'\n+\n+class Data(object):\n+    \"\"\"\n+    Class to store parsed data\n+    \"\"\"\n+    \n+    def __init__(self, file):\n+        self.HTML = \"\"\n+        self.FILE = file\n+        self.load_data()\n+\n+    def load_data(self):\n+        with open(self.FILE,'r') as data_file:\n+            document = data_file.read()\n+            self.HTML = document\n+\n+    def get_raw_data(self):\n+        return self.HTML\n+\n+    def get_file(self):\n+        return self.FILE\n+\n+\n+class Parser(object):\n+    \"\"\"\n+    Parser to parse HTML files\n+    \"\"\"\n+    \n+    def __init__(self, data_object):\n+        self.file_being_used = data_object.get_file()\n+        self.file_name = self.file_being_used.split('/').pop()\n+        self.sections = []\n+        self.soup = BeautifulSoup(data_object.get_raw_data(), 'html.parser')\n+\n+    def parse_for_data(self):\n+        for header in self.soup.find_all(['h2']):\n+            section = self.parse_section(header)\n+            section['example'] = self.clean_formatting(self.get_example(header))\n+            if section['paragraph'] and section['example']:\n+                section['abstract'] = '{}<br><pre><code>{}</code></pre>'.format(section['paragraph'], section['example'])","path":"lib/fathead/flask/parse.py","position":48,"original_position":48,"commit_id":"b438f3537b45b277feb5081a81968fb4445b3ea5","original_commit_id":"b438f3537b45b277feb5081a81968fb4445b3ea5","user":{"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},"body":"Please remove the `<br>` -- it's not needed","created_at":"2016-10-27T19:52:15Z","updated_at":"2016-10-27T19:52:15Z","html_url":"https://github.com/duckduckgo/zeroclickinfo-fathead/pull/459#discussion_r85413857","pull_request_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/comments/85413857"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-fathead/pull/459#discussion_r85413857"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459","id":89502737,"html_url":"https://github.com/duckduckgo/zeroclickinfo-fathead/pull/459","diff_url":"https://github.com/duckduckgo/zeroclickinfo-fathead/pull/459.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-fathead/pull/459.patch","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues/459","number":459,"state":"open","locked":false,"title":"Added flask fathead (Issue #444)","user":{"login":"shanmbic","id":5183286,"avatar_url":"https://avatars.githubusercontent.com/u/5183286?v=3","gravatar_id":"","url":"https://api.github.com/users/shanmbic","html_url":"https://github.com/shanmbic","followers_url":"https://api.github.com/users/shanmbic/followers","following_url":"https://api.github.com/users/shanmbic/following{/other_user}","gists_url":"https://api.github.com/users/shanmbic/gists{/gist_id}","starred_url":"https://api.github.com/users/shanmbic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanmbic/subscriptions","organizations_url":"https://api.github.com/users/shanmbic/orgs","repos_url":"https://api.github.com/users/shanmbic/repos","events_url":"https://api.github.com/users/shanmbic/events{/privacy}","received_events_url":"https://api.github.com/users/shanmbic/received_events","type":"User","site_admin":false},"body":"The PR adds the Python-Flask documentation fathead (Issue #444 ).  ","created_at":"2016-10-15T18:58:20Z","updated_at":"2016-10-27T19:54:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cddad7c79789df72aa6f4b4f486590dcce356e59","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},"assignees":[{"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-fathead/pulls/459/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues/459/comments","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/statuses/b438f3537b45b277feb5081a81968fb4445b3ea5","head":{"label":"shanmbic:master","ref":"master","sha":"b438f3537b45b277feb5081a81968fb4445b3ea5","user":{"login":"shanmbic","id":5183286,"avatar_url":"https://avatars.githubusercontent.com/u/5183286?v=3","gravatar_id":"","url":"https://api.github.com/users/shanmbic","html_url":"https://github.com/shanmbic","followers_url":"https://api.github.com/users/shanmbic/followers","following_url":"https://api.github.com/users/shanmbic/following{/other_user}","gists_url":"https://api.github.com/users/shanmbic/gists{/gist_id}","starred_url":"https://api.github.com/users/shanmbic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanmbic/subscriptions","organizations_url":"https://api.github.com/users/shanmbic/orgs","repos_url":"https://api.github.com/users/shanmbic/repos","events_url":"https://api.github.com/users/shanmbic/events{/privacy}","received_events_url":"https://api.github.com/users/shanmbic/received_events","type":"User","site_admin":false},"repo":{"id":70904636,"name":"zeroclickinfo-fathead","full_name":"shanmbic/zeroclickinfo-fathead","owner":{"login":"shanmbic","id":5183286,"avatar_url":"https://avatars.githubusercontent.com/u/5183286?v=3","gravatar_id":"","url":"https://api.github.com/users/shanmbic","html_url":"https://github.com/shanmbic","followers_url":"https://api.github.com/users/shanmbic/followers","following_url":"https://api.github.com/users/shanmbic/following{/other_user}","gists_url":"https://api.github.com/users/shanmbic/gists{/gist_id}","starred_url":"https://api.github.com/users/shanmbic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanmbic/subscriptions","organizations_url":"https://api.github.com/users/shanmbic/orgs","repos_url":"https://api.github.com/users/shanmbic/repos","events_url":"https://api.github.com/users/shanmbic/events{/privacy}","received_events_url":"https://api.github.com/users/shanmbic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shanmbic/zeroclickinfo-fathead","description":"DuckDuckGo Instant Answers based on keyword data files","fork":true,"url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead","forks_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/forks","keys_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/teams","hooks_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/hooks","issue_events_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/issues/events{/number}","events_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/events","assignees_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/assignees{/user}","branches_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/branches{/branch}","tags_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/tags","blobs_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/git/refs{/sha}","trees_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/statuses/{sha}","languages_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/languages","stargazers_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/stargazers","contributors_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/contributors","subscribers_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/subscribers","subscription_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/subscription","commits_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/commits{/sha}","git_commits_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/git/commits{/sha}","comments_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/comments{/number}","issue_comment_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/issues/comments{/number}","contents_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/contents/{+path}","compare_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/merges","archive_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/downloads","issues_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/issues{/number}","pulls_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/pulls{/number}","milestones_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/milestones{/number}","notifications_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/labels{/name}","releases_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/releases{/id}","deployments_url":"https://api.github.com/repos/shanmbic/zeroclickinfo-fathead/deployments","created_at":"2016-10-14T11:37:42Z","updated_at":"2016-10-14T11:37:43Z","pushed_at":"2016-10-15T18:46:04Z","git_url":"git://github.com/shanmbic/zeroclickinfo-fathead.git","ssh_url":"git@github.com:shanmbic/zeroclickinfo-fathead.git","clone_url":"https://github.com/shanmbic/zeroclickinfo-fathead.git","svn_url":"https://github.com/shanmbic/zeroclickinfo-fathead","homepage":"http://duckduckhack.com/","size":12205,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"duckduckgo:master","ref":"master","sha":"d4b667a6d96bce7644261e2466ab02819d0af56d","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":1997918,"name":"zeroclickinfo-fathead","full_name":"duckduckgo/zeroclickinfo-fathead","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-fathead","description":"DuckDuckGo Instant Answers based on keyword data files","fork":false,"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead","forks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/forks","keys_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/teams","hooks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/events","assignees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/tags","blobs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/subscription","commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/merges","archive_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/downloads","issues_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/releases{/id}","deployments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/deployments","created_at":"2011-07-04T23:42:33Z","updated_at":"2016-10-25T17:30:14Z","pushed_at":"2016-10-27T19:20:35Z","git_url":"git://github.com/duckduckgo/zeroclickinfo-fathead.git","ssh_url":"git@github.com:duckduckgo/zeroclickinfo-fathead.git","clone_url":"https://github.com/duckduckgo/zeroclickinfo-fathead.git","svn_url":"https://github.com/duckduckgo/zeroclickinfo-fathead","homepage":"http://duckduckhack.com/","size":14428,"stargazers_count":172,"watchers_count":172,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":296,"mirror_url":null,"open_issues_count":116,"forks":296,"open_issues":116,"watchers":172,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-fathead/pull/459"},"issue":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues/459"},"comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/issues/459/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/pulls/459/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-fathead/statuses/b438f3537b45b277feb5081a81968fb4445b3ea5"}}}}
{"actor":{"display_login":"moollaza"}}