{"action":"created","comment":{"url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments/29430512","id":29430512,"diff_hunk":"@@ -0,0 +1,183 @@\n+module HessenScraper\n+  BASE_URL = 'http://starweb.hessen.de'\n+\n+  def self.extract_blocks(page)\n+    page.search('//*[@id=\"container\"]/form/div/div/div/table/tbody')\n+  end\n+\n+  def self.extract_detail_block(detail_page)\n+    detail_page.at_css('#listTable pre')\n+  end\n+\n+  def self.extract_reference(block)\n+    block.at_css('span[name=\"OFR_Drs\"]').content.split('/')\n+  end\n+\n+  def self.extract_interpellation_type(block)\n+    doc_type = block.at_css('span[name=\"OFR_Vorgtyp\"]')\n+    doc_type= doc_type.content.split('/')[1]\n+\n+    if doc_type.start_with?('Kleine')\n+      return Paper::DOCTYPE_MINOR_INTERPELLATION\n+    end\n+    if doc_type.start_with?('Große')\n+      return Paper::DOCTYPE_MAJOR_INTERPELLATION\n+    end\n+    nil\n+  end\n+\n+  def self.extract_title(block)\n+    span = block.at_css('span[name=\"OFR_Betreff\"]')\n+    title = span.at_css('.textlink')\n+    title = span.at_css('.textLink') if title.nil?\n+    title.content.gsub(/\\p{Z}+/, ' ').strip\n+  end\n+\n+  def self.extract_originator_text (detail_block)\n+    detail_block.child.next.next.text\n+  end\n+\n+  def self.extract_paper (block)\n+    leg, ref = extract_reference(block)\n+    {\n+      legislative_term: leg,\n+      full_reference: ref,\n+      reference: [leg, ref].join('/'),\n+      doctype: extract_interpellation_type(block),\n+      title: extract_title(block),\n+      is_answer: true,\n+    }\n+  end\n+\n+  def self.extract_result_from_search(page)\n+    page.search('//tbody[@name=\"RecordRepeatStart\"]').first\n+  end\n+\n+=begin","path":"app/scrapers/hessen_scraper.rb","position":56,"original_position":56,"commit_id":"4bf6499f5da9f327d03570794ba4e760ccfaa68e","original_commit_id":"4bf6499f5da9f327d03570794ba4e760ccfaa68e","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Do not use block comments.","created_at":"2015-04-30T13:50:39Z","updated_at":"2015-04-30T13:50:39Z","html_url":"https://github.com/robbi5/kleineanfragen/pull/20#discussion_r29430512","pull_request_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments/29430512"},"html":{"href":"https://github.com/robbi5/kleineanfragen/pull/20#discussion_r29430512"},"pull_request":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20","id":34461213,"html_url":"https://github.com/robbi5/kleineanfragen/pull/20","diff_url":"https://github.com/robbi5/kleineanfragen/pull/20.diff","patch_url":"https://github.com/robbi5/kleineanfragen/pull/20.patch","issue_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/20","number":20,"state":"open","locked":false,"title":"hessen scraper","user":{"login":"globalworming","id":2108984,"avatar_url":"https://avatars.githubusercontent.com/u/2108984?v=3","gravatar_id":"","url":"https://api.github.com/users/globalworming","html_url":"https://github.com/globalworming","followers_url":"https://api.github.com/users/globalworming/followers","following_url":"https://api.github.com/users/globalworming/following{/other_user}","gists_url":"https://api.github.com/users/globalworming/gists{/gist_id}","starred_url":"https://api.github.com/users/globalworming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalworming/subscriptions","organizations_url":"https://api.github.com/users/globalworming/orgs","repos_url":"https://api.github.com/users/globalworming/repos","events_url":"https://api.github.com/users/globalworming/events{/privacy}","received_events_url":"https://api.github.com/users/globalworming/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-30T13:50:35Z","updated_at":"2015-04-30T13:50:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac806b5cff8e5595c4304299cbc8c52d3cd9e928","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20/commits","review_comments_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20/comments","review_comment_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/20/comments","statuses_url":"https://api.github.com/repos/robbi5/kleineanfragen/statuses/4bf6499f5da9f327d03570794ba4e760ccfaa68e","head":{"label":"globalworming:he-scraper","ref":"he-scraper","sha":"4bf6499f5da9f327d03570794ba4e760ccfaa68e","user":{"login":"globalworming","id":2108984,"avatar_url":"https://avatars.githubusercontent.com/u/2108984?v=3","gravatar_id":"","url":"https://api.github.com/users/globalworming","html_url":"https://github.com/globalworming","followers_url":"https://api.github.com/users/globalworming/followers","following_url":"https://api.github.com/users/globalworming/following{/other_user}","gists_url":"https://api.github.com/users/globalworming/gists{/gist_id}","starred_url":"https://api.github.com/users/globalworming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalworming/subscriptions","organizations_url":"https://api.github.com/users/globalworming/orgs","repos_url":"https://api.github.com/users/globalworming/repos","events_url":"https://api.github.com/users/globalworming/events{/privacy}","received_events_url":"https://api.github.com/users/globalworming/received_events","type":"User","site_admin":false},"repo":{"id":30397914,"name":"kleineanfragen","full_name":"globalworming/kleineanfragen","owner":{"login":"globalworming","id":2108984,"avatar_url":"https://avatars.githubusercontent.com/u/2108984?v=3","gravatar_id":"","url":"https://api.github.com/users/globalworming","html_url":"https://github.com/globalworming","followers_url":"https://api.github.com/users/globalworming/followers","following_url":"https://api.github.com/users/globalworming/following{/other_user}","gists_url":"https://api.github.com/users/globalworming/gists{/gist_id}","starred_url":"https://api.github.com/users/globalworming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalworming/subscriptions","organizations_url":"https://api.github.com/users/globalworming/orgs","repos_url":"https://api.github.com/users/globalworming/repos","events_url":"https://api.github.com/users/globalworming/events{/privacy}","received_events_url":"https://api.github.com/users/globalworming/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/globalworming/kleineanfragen","description":"","fork":true,"url":"https://api.github.com/repos/globalworming/kleineanfragen","forks_url":"https://api.github.com/repos/globalworming/kleineanfragen/forks","keys_url":"https://api.github.com/repos/globalworming/kleineanfragen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globalworming/kleineanfragen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globalworming/kleineanfragen/teams","hooks_url":"https://api.github.com/repos/globalworming/kleineanfragen/hooks","issue_events_url":"https://api.github.com/repos/globalworming/kleineanfragen/issues/events{/number}","events_url":"https://api.github.com/repos/globalworming/kleineanfragen/events","assignees_url":"https://api.github.com/repos/globalworming/kleineanfragen/assignees{/user}","branches_url":"https://api.github.com/repos/globalworming/kleineanfragen/branches{/branch}","tags_url":"https://api.github.com/repos/globalworming/kleineanfragen/tags","blobs_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/refs{/sha}","trees_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globalworming/kleineanfragen/statuses/{sha}","languages_url":"https://api.github.com/repos/globalworming/kleineanfragen/languages","stargazers_url":"https://api.github.com/repos/globalworming/kleineanfragen/stargazers","contributors_url":"https://api.github.com/repos/globalworming/kleineanfragen/contributors","subscribers_url":"https://api.github.com/repos/globalworming/kleineanfragen/subscribers","subscription_url":"https://api.github.com/repos/globalworming/kleineanfragen/subscription","commits_url":"https://api.github.com/repos/globalworming/kleineanfragen/commits{/sha}","git_commits_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/commits{/sha}","comments_url":"https://api.github.com/repos/globalworming/kleineanfragen/comments{/number}","issue_comment_url":"https://api.github.com/repos/globalworming/kleineanfragen/issues/comments{/number}","contents_url":"https://api.github.com/repos/globalworming/kleineanfragen/contents/{+path}","compare_url":"https://api.github.com/repos/globalworming/kleineanfragen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globalworming/kleineanfragen/merges","archive_url":"https://api.github.com/repos/globalworming/kleineanfragen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globalworming/kleineanfragen/downloads","issues_url":"https://api.github.com/repos/globalworming/kleineanfragen/issues{/number}","pulls_url":"https://api.github.com/repos/globalworming/kleineanfragen/pulls{/number}","milestones_url":"https://api.github.com/repos/globalworming/kleineanfragen/milestones{/number}","notifications_url":"https://api.github.com/repos/globalworming/kleineanfragen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globalworming/kleineanfragen/labels{/name}","releases_url":"https://api.github.com/repos/globalworming/kleineanfragen/releases{/id}","created_at":"2015-02-06T06:06:10Z","updated_at":"2015-03-12T12:21:48Z","pushed_at":"2015-04-30T13:48:48Z","git_url":"git://github.com/globalworming/kleineanfragen.git","ssh_url":"git@github.com:globalworming/kleineanfragen.git","clone_url":"https://github.com/globalworming/kleineanfragen.git","svn_url":"https://github.com/globalworming/kleineanfragen","homepage":"https://kleineanfragen.de","size":4529,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"robbi5:master","ref":"master","sha":"f6ed9cc78d7d8705da638bf02521f7ab6e91f3ba","user":{"login":"robbi5","id":172415,"avatar_url":"https://avatars.githubusercontent.com/u/172415?v=3","gravatar_id":"","url":"https://api.github.com/users/robbi5","html_url":"https://github.com/robbi5","followers_url":"https://api.github.com/users/robbi5/followers","following_url":"https://api.github.com/users/robbi5/following{/other_user}","gists_url":"https://api.github.com/users/robbi5/gists{/gist_id}","starred_url":"https://api.github.com/users/robbi5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbi5/subscriptions","organizations_url":"https://api.github.com/users/robbi5/orgs","repos_url":"https://api.github.com/users/robbi5/repos","events_url":"https://api.github.com/users/robbi5/events{/privacy}","received_events_url":"https://api.github.com/users/robbi5/received_events","type":"User","site_admin":false},"repo":{"id":23664133,"name":"kleineanfragen","full_name":"robbi5/kleineanfragen","owner":{"login":"robbi5","id":172415,"avatar_url":"https://avatars.githubusercontent.com/u/172415?v=3","gravatar_id":"","url":"https://api.github.com/users/robbi5","html_url":"https://github.com/robbi5","followers_url":"https://api.github.com/users/robbi5/followers","following_url":"https://api.github.com/users/robbi5/following{/other_user}","gists_url":"https://api.github.com/users/robbi5/gists{/gist_id}","starred_url":"https://api.github.com/users/robbi5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbi5/subscriptions","organizations_url":"https://api.github.com/users/robbi5/orgs","repos_url":"https://api.github.com/users/robbi5/repos","events_url":"https://api.github.com/users/robbi5/events{/privacy}","received_events_url":"https://api.github.com/users/robbi5/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robbi5/kleineanfragen","description":"Collecting kleine Anfragen from Parlamentsdokumentationssystemen for easy search- and linkability","fork":false,"url":"https://api.github.com/repos/robbi5/kleineanfragen","forks_url":"https://api.github.com/repos/robbi5/kleineanfragen/forks","keys_url":"https://api.github.com/repos/robbi5/kleineanfragen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robbi5/kleineanfragen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robbi5/kleineanfragen/teams","hooks_url":"https://api.github.com/repos/robbi5/kleineanfragen/hooks","issue_events_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/events{/number}","events_url":"https://api.github.com/repos/robbi5/kleineanfragen/events","assignees_url":"https://api.github.com/repos/robbi5/kleineanfragen/assignees{/user}","branches_url":"https://api.github.com/repos/robbi5/kleineanfragen/branches{/branch}","tags_url":"https://api.github.com/repos/robbi5/kleineanfragen/tags","blobs_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/refs{/sha}","trees_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robbi5/kleineanfragen/statuses/{sha}","languages_url":"https://api.github.com/repos/robbi5/kleineanfragen/languages","stargazers_url":"https://api.github.com/repos/robbi5/kleineanfragen/stargazers","contributors_url":"https://api.github.com/repos/robbi5/kleineanfragen/contributors","subscribers_url":"https://api.github.com/repos/robbi5/kleineanfragen/subscribers","subscription_url":"https://api.github.com/repos/robbi5/kleineanfragen/subscription","commits_url":"https://api.github.com/repos/robbi5/kleineanfragen/commits{/sha}","git_commits_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/commits{/sha}","comments_url":"https://api.github.com/repos/robbi5/kleineanfragen/comments{/number}","issue_comment_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/comments{/number}","contents_url":"https://api.github.com/repos/robbi5/kleineanfragen/contents/{+path}","compare_url":"https://api.github.com/repos/robbi5/kleineanfragen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robbi5/kleineanfragen/merges","archive_url":"https://api.github.com/repos/robbi5/kleineanfragen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robbi5/kleineanfragen/downloads","issues_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues{/number}","pulls_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls{/number}","milestones_url":"https://api.github.com/repos/robbi5/kleineanfragen/milestones{/number}","notifications_url":"https://api.github.com/repos/robbi5/kleineanfragen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robbi5/kleineanfragen/labels{/name}","releases_url":"https://api.github.com/repos/robbi5/kleineanfragen/releases{/id}","created_at":"2014-09-04T13:47:44Z","updated_at":"2015-04-29T13:25:56Z","pushed_at":"2015-04-30T13:50:35Z","git_url":"git://github.com/robbi5/kleineanfragen.git","ssh_url":"git@github.com:robbi5/kleineanfragen.git","clone_url":"https://github.com/robbi5/kleineanfragen.git","svn_url":"https://github.com/robbi5/kleineanfragen","homepage":"https://kleineanfragen.de","size":5349,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20"},"html":{"href":"https://github.com/robbi5/kleineanfragen/pull/20"},"issue":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/issues/20"},"comments":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/statuses/4bf6499f5da9f327d03570794ba4e760ccfaa68e"}}}}