{"action":"created","comment":{"url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/comments/191873073","pull_request_review_id":124531859,"id":191873073,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MTg3MzA3Mw==","diff_hunk":"@@ -0,0 +1,119 @@\n+from dateparser import parse\n+import datetime as dt\n+import re\n+\n+import scrapy\n+\n+from gazette.items import Gazette\n+\n+class PrCuritibaSpider(scrapy.Spider):\n+    MUNICIPALITY_ID = '4106902'\n+    name = 'pr_curitiba'\n+    allowed_domains = ['legisladocexterno.curitiba.pr.gov.br']\n+    start_urls = ['http://legisladocexterno.curitiba.pr.gov.br/DiarioConsultaExterna_Pesquisa.aspx']\n+\n+\n+    def parse(self, response):\n+        \"\"\"\n+        The Curitiba website is a statefull page, so we can't just build the\n+        request from zero, we have to resend the viewstate with every request.\n+        @url http://legisladocexterno.curitiba.pr.gov.br/DiarioConsultaExterna_Pesquisa.aspx\n+        @returns requests 1\n+        \"\"\"\n+        todays_date = dt.date.today()\n+        current_year = todays_date.year\n+        for year in range(current_year, 2014, -1):\n+            yield self.scrap_year(response, year)\n+\n+    def scrap_year(self, response, year):\n+        return scrapy.FormRequest.from_response(\n+            response,\n+            formdata={\n+                'ctl00$cphMasterPrincipal$ddlGrAno': str(year)\n+            },\n+            callback=self.parse_year\n+        )\n+\n+\n+    def parse_year(self, response):\n+        for i in range(12):\n+            yield self.scrap_month(response, i)\n+\n+    def scrap_month(self, response, month):","path":"processing/data_collection/gazette/spiders/pr_curitiba.py","position":42,"original_position":42,"commit_id":"3be04c0f007dd527baecc269acccb6762a34078e","original_commit_id":"3be04c0f007dd527baecc269acccb6762a34078e","user":{"login":"rennerocha","id":382887,"node_id":"MDQ6VXNlcjM4Mjg4Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/382887?v=4","gravatar_id":"","url":"https://api.github.com/users/rennerocha","html_url":"https://github.com/rennerocha","followers_url":"https://api.github.com/users/rennerocha/followers","following_url":"https://api.github.com/users/rennerocha/following{/other_user}","gists_url":"https://api.github.com/users/rennerocha/gists{/gist_id}","starred_url":"https://api.github.com/users/rennerocha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rennerocha/subscriptions","organizations_url":"https://api.github.com/users/rennerocha/orgs","repos_url":"https://api.github.com/users/rennerocha/repos","events_url":"https://api.github.com/users/rennerocha/events{/privacy}","received_events_url":"https://api.github.com/users/rennerocha/received_events","type":"User","site_admin":false},"body":"It is scrap**e**, not scrap.","created_at":"2018-05-30T18:23:09Z","updated_at":"2018-05-30T18:46:50Z","html_url":"https://github.com/okfn-brasil/diario-oficial/pull/42#discussion_r191873073","pull_request_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/comments/191873073"},"html":{"href":"https://github.com/okfn-brasil/diario-oficial/pull/42#discussion_r191873073"},"pull_request":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42","id":188865307,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg4ODY1MzA3","html_url":"https://github.com/okfn-brasil/diario-oficial/pull/42","diff_url":"https://github.com/okfn-brasil/diario-oficial/pull/42.diff","patch_url":"https://github.com/okfn-brasil/diario-oficial/pull/42.patch","issue_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues/42","number":42,"state":"open","locked":false,"title":"Curitiba","user":{"login":"antoniovendramin","id":5678272,"node_id":"MDQ6VXNlcjU2NzgyNzI=","avatar_url":"https://avatars3.githubusercontent.com/u/5678272?v=4","gravatar_id":"","url":"https://api.github.com/users/antoniovendramin","html_url":"https://github.com/antoniovendramin","followers_url":"https://api.github.com/users/antoniovendramin/followers","following_url":"https://api.github.com/users/antoniovendramin/following{/other_user}","gists_url":"https://api.github.com/users/antoniovendramin/gists{/gist_id}","starred_url":"https://api.github.com/users/antoniovendramin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoniovendramin/subscriptions","organizations_url":"https://api.github.com/users/antoniovendramin/orgs","repos_url":"https://api.github.com/users/antoniovendramin/repos","events_url":"https://api.github.com/users/antoniovendramin/events{/privacy}","received_events_url":"https://api.github.com/users/antoniovendramin/received_events","type":"User","site_admin":false},"body":"Lendo os diários oficiais de Curitiba.\r\nCuritiba publica os diários do executivo e legislativo no mesmo arquivo.\r\nA plataforma onde é publicado o arquivo utiliza a tecnologia ASP.NET, com isso o site é statefull obrigando-nos a reenviar os paramentros do estado em todas as requests.","created_at":"2018-05-17T21:23:56Z","updated_at":"2018-05-30T18:46:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58cbd851f910c99235e958e2b4b7d32b83ed0fba","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42/commits","review_comments_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42/comments","review_comment_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/comments{/number}","comments_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues/42/comments","statuses_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/statuses/3be04c0f007dd527baecc269acccb6762a34078e","head":{"label":"beothorn:curitiba","ref":"curitiba","sha":"3be04c0f007dd527baecc269acccb6762a34078e","user":{"login":"beothorn","id":410600,"node_id":"MDQ6VXNlcjQxMDYwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/410600?v=4","gravatar_id":"","url":"https://api.github.com/users/beothorn","html_url":"https://github.com/beothorn","followers_url":"https://api.github.com/users/beothorn/followers","following_url":"https://api.github.com/users/beothorn/following{/other_user}","gists_url":"https://api.github.com/users/beothorn/gists{/gist_id}","starred_url":"https://api.github.com/users/beothorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beothorn/subscriptions","organizations_url":"https://api.github.com/users/beothorn/orgs","repos_url":"https://api.github.com/users/beothorn/repos","events_url":"https://api.github.com/users/beothorn/events{/privacy}","received_events_url":"https://api.github.com/users/beothorn/received_events","type":"User","site_admin":false},"repo":{"id":131347229,"node_id":"MDEwOlJlcG9zaXRvcnkxMzEzNDcyMjk=","name":"diario-oficial","full_name":"beothorn/diario-oficial","owner":{"login":"beothorn","id":410600,"node_id":"MDQ6VXNlcjQxMDYwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/410600?v=4","gravatar_id":"","url":"https://api.github.com/users/beothorn","html_url":"https://github.com/beothorn","followers_url":"https://api.github.com/users/beothorn/followers","following_url":"https://api.github.com/users/beothorn/following{/other_user}","gists_url":"https://api.github.com/users/beothorn/gists{/gist_id}","starred_url":"https://api.github.com/users/beothorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beothorn/subscriptions","organizations_url":"https://api.github.com/users/beothorn/orgs","repos_url":"https://api.github.com/users/beothorn/repos","events_url":"https://api.github.com/users/beothorn/events{/privacy}","received_events_url":"https://api.github.com/users/beothorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beothorn/diario-oficial","description":"📰 Brazilian government gazettes, accessible to everyone.","fork":true,"url":"https://api.github.com/repos/beothorn/diario-oficial","forks_url":"https://api.github.com/repos/beothorn/diario-oficial/forks","keys_url":"https://api.github.com/repos/beothorn/diario-oficial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beothorn/diario-oficial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beothorn/diario-oficial/teams","hooks_url":"https://api.github.com/repos/beothorn/diario-oficial/hooks","issue_events_url":"https://api.github.com/repos/beothorn/diario-oficial/issues/events{/number}","events_url":"https://api.github.com/repos/beothorn/diario-oficial/events","assignees_url":"https://api.github.com/repos/beothorn/diario-oficial/assignees{/user}","branches_url":"https://api.github.com/repos/beothorn/diario-oficial/branches{/branch}","tags_url":"https://api.github.com/repos/beothorn/diario-oficial/tags","blobs_url":"https://api.github.com/repos/beothorn/diario-oficial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beothorn/diario-oficial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beothorn/diario-oficial/git/refs{/sha}","trees_url":"https://api.github.com/repos/beothorn/diario-oficial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beothorn/diario-oficial/statuses/{sha}","languages_url":"https://api.github.com/repos/beothorn/diario-oficial/languages","stargazers_url":"https://api.github.com/repos/beothorn/diario-oficial/stargazers","contributors_url":"https://api.github.com/repos/beothorn/diario-oficial/contributors","subscribers_url":"https://api.github.com/repos/beothorn/diario-oficial/subscribers","subscription_url":"https://api.github.com/repos/beothorn/diario-oficial/subscription","commits_url":"https://api.github.com/repos/beothorn/diario-oficial/commits{/sha}","git_commits_url":"https://api.github.com/repos/beothorn/diario-oficial/git/commits{/sha}","comments_url":"https://api.github.com/repos/beothorn/diario-oficial/comments{/number}","issue_comment_url":"https://api.github.com/repos/beothorn/diario-oficial/issues/comments{/number}","contents_url":"https://api.github.com/repos/beothorn/diario-oficial/contents/{+path}","compare_url":"https://api.github.com/repos/beothorn/diario-oficial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beothorn/diario-oficial/merges","archive_url":"https://api.github.com/repos/beothorn/diario-oficial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beothorn/diario-oficial/downloads","issues_url":"https://api.github.com/repos/beothorn/diario-oficial/issues{/number}","pulls_url":"https://api.github.com/repos/beothorn/diario-oficial/pulls{/number}","milestones_url":"https://api.github.com/repos/beothorn/diario-oficial/milestones{/number}","notifications_url":"https://api.github.com/repos/beothorn/diario-oficial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beothorn/diario-oficial/labels{/name}","releases_url":"https://api.github.com/repos/beothorn/diario-oficial/releases{/id}","deployments_url":"https://api.github.com/repos/beothorn/diario-oficial/deployments","created_at":"2018-04-27T21:38:48Z","updated_at":"2018-04-27T21:38:50Z","pushed_at":"2018-05-30T17:25:08Z","git_url":"git://github.com/beothorn/diario-oficial.git","ssh_url":"git@github.com:beothorn/diario-oficial.git","clone_url":"https://github.com/beothorn/diario-oficial.git","svn_url":"https://github.com/beothorn/diario-oficial","homepage":"https://diario.serenata.ai/","size":11686,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"okfn-brasil:master","ref":"master","sha":"d190abf3fa239e0fb92d1e676b30fdc9ecae9ce5","user":{"login":"okfn-brasil","id":1666382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjYzODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1666382?v=4","gravatar_id":"","url":"https://api.github.com/users/okfn-brasil","html_url":"https://github.com/okfn-brasil","followers_url":"https://api.github.com/users/okfn-brasil/followers","following_url":"https://api.github.com/users/okfn-brasil/following{/other_user}","gists_url":"https://api.github.com/users/okfn-brasil/gists{/gist_id}","starred_url":"https://api.github.com/users/okfn-brasil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okfn-brasil/subscriptions","organizations_url":"https://api.github.com/users/okfn-brasil/orgs","repos_url":"https://api.github.com/users/okfn-brasil/repos","events_url":"https://api.github.com/users/okfn-brasil/events{/privacy}","received_events_url":"https://api.github.com/users/okfn-brasil/received_events","type":"Organization","site_admin":false},"repo":{"id":127598755,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc1OTg3NTU=","name":"diario-oficial","full_name":"okfn-brasil/diario-oficial","owner":{"login":"okfn-brasil","id":1666382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NjYzODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1666382?v=4","gravatar_id":"","url":"https://api.github.com/users/okfn-brasil","html_url":"https://github.com/okfn-brasil","followers_url":"https://api.github.com/users/okfn-brasil/followers","following_url":"https://api.github.com/users/okfn-brasil/following{/other_user}","gists_url":"https://api.github.com/users/okfn-brasil/gists{/gist_id}","starred_url":"https://api.github.com/users/okfn-brasil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okfn-brasil/subscriptions","organizations_url":"https://api.github.com/users/okfn-brasil/orgs","repos_url":"https://api.github.com/users/okfn-brasil/repos","events_url":"https://api.github.com/users/okfn-brasil/events{/privacy}","received_events_url":"https://api.github.com/users/okfn-brasil/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/okfn-brasil/diario-oficial","description":"📰 Brazilian government gazettes, accessible to everyone.","fork":false,"url":"https://api.github.com/repos/okfn-brasil/diario-oficial","forks_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/forks","keys_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/teams","hooks_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/hooks","issue_events_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues/events{/number}","events_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/events","assignees_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/assignees{/user}","branches_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/branches{/branch}","tags_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/tags","blobs_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/git/refs{/sha}","trees_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/statuses/{sha}","languages_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/languages","stargazers_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/stargazers","contributors_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/contributors","subscribers_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/subscribers","subscription_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/subscription","commits_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/commits{/sha}","git_commits_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/git/commits{/sha}","comments_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/comments{/number}","issue_comment_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues/comments{/number}","contents_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/contents/{+path}","compare_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/merges","archive_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/downloads","issues_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues{/number}","pulls_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls{/number}","milestones_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/milestones{/number}","notifications_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/labels{/name}","releases_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/releases{/id}","deployments_url":"https://api.github.com/repos/okfn-brasil/diario-oficial/deployments","created_at":"2018-04-01T05:01:21Z","updated_at":"2018-05-29T02:52:52Z","pushed_at":"2018-05-30T18:43:15Z","git_url":"git://github.com/okfn-brasil/diario-oficial.git","ssh_url":"git@github.com:okfn-brasil/diario-oficial.git","clone_url":"https://github.com/okfn-brasil/diario-oficial.git","svn_url":"https://github.com/okfn-brasil/diario-oficial","homepage":"https://diario.serenata.ai/","size":11668,"stargazers_count":156,"watchers_count":156,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":49,"open_issues":31,"watchers":156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42"},"html":{"href":"https://github.com/okfn-brasil/diario-oficial/pull/42"},"issue":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues/42"},"comments":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/okfn-brasil/diario-oficial/statuses/3be04c0f007dd527baecc269acccb6762a34078e"}},"author_association":"NONE"}}
{"actor":{"display_login":"rennerocha"}}