{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/comments/85548623","pull_request_review_id":6260069,"id":85548623,"diff_hunk":"@@ -0,0 +1,48 @@\n+import scrapy\n+import utils\n+from datetime import datetime\n+\n+\n+def serialize_date(value):\n+    \"\"\"\n+    Serialize the string date to a datetime value.\n+    :param value:\n+    :return:\n+    \"\"\"\n+    return datetime.strptime(value, '%d %b %Y')\n+\n+\n+class PivotalSpider(scrapy.Spider):\n+    utils.init_datadog()\n+\n+    name = \"pivotal_security\"\n+    start_urls = ['https://pivotal.io/security']\n+\n+    def parse(self, response):\n+        rows = response.css('table tr')\n+\n+        if len(rows) <= 0:\n+            utils.Report.warning()\n+\n+        for cve in rows:\n+            fields = cve.css('td')\n+\n+            try:\n+                date = serialize_date(utils.get_string(fields[0].css('::text').extract()))\n+            except ValueError:\n+                continue","path":"pivotal.py","position":33,"original_position":33,"commit_id":"d48c5c55291bd5e1281089402dad11b1b758213d","original_commit_id":"df9901670055138602b93fe6e164bbd88f0b03e5","user":{"login":"keymon","id":280032,"avatar_url":"https://avatars.githubusercontent.com/u/280032?v=3","gravatar_id":"","url":"https://api.github.com/users/keymon","html_url":"https://github.com/keymon","followers_url":"https://api.github.com/users/keymon/followers","following_url":"https://api.github.com/users/keymon/following{/other_user}","gists_url":"https://api.github.com/users/keymon/gists{/gist_id}","starred_url":"https://api.github.com/users/keymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keymon/subscriptions","organizations_url":"https://api.github.com/users/keymon/orgs","repos_url":"https://api.github.com/users/keymon/repos","events_url":"https://api.github.com/users/keymon/events{/privacy}","received_events_url":"https://api.github.com/users/keymon/received_events","type":"User","site_admin":false},"body":"We should report the number of errors parsing to datadog, so we know that the scrappy thing is not working anymore.","created_at":"2016-10-28T15:03:55Z","updated_at":"2016-10-28T15:04:03Z","html_url":"https://github.com/alphagov/paas-cve-notifier/pull/1#discussion_r85548623","pull_request_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/comments/85548623"},"html":{"href":"https://github.com/alphagov/paas-cve-notifier/pull/1#discussion_r85548623"},"pull_request":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1","id":91363654,"html_url":"https://github.com/alphagov/paas-cve-notifier/pull/1","diff_url":"https://github.com/alphagov/paas-cve-notifier/pull/1.diff","patch_url":"https://github.com/alphagov/paas-cve-notifier/pull/1.patch","issue_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/1","number":1,"state":"open","locked":false,"title":"[#127345741] Ensure CVE Notifications","user":{"login":"paroxp","id":2418945,"avatar_url":"https://avatars.githubusercontent.com/u/2418945?v=3","gravatar_id":"","url":"https://api.github.com/users/paroxp","html_url":"https://github.com/paroxp","followers_url":"https://api.github.com/users/paroxp/followers","following_url":"https://api.github.com/users/paroxp/following{/other_user}","gists_url":"https://api.github.com/users/paroxp/gists{/gist_id}","starred_url":"https://api.github.com/users/paroxp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paroxp/subscriptions","organizations_url":"https://api.github.com/users/paroxp/orgs","repos_url":"https://api.github.com/users/paroxp/repos","events_url":"https://api.github.com/users/paroxp/events{/privacy}","received_events_url":"https://api.github.com/users/paroxp/received_events","type":"User","site_admin":false},"body":"## What\r\n\r\nWe need to scrape some details, from https://pivotal.io/security page, in order to be able to get notified about any new CVE's and act in time.\r\n\r\nWe have chosen Python for the scraper, as our research has come down, Scrapy is the best library out on the market suitable for scraping.\r\n\r\n## How to review\r\n\r\nIt should be reviewed along with the PR on [`paas-cf`](https://github.com/alphagov/paas-cf/pull/573).\r\n\r\nYou may also be able, to review this by simply cloning the repo, and running the script as described in the readme file, along with `DD_API_KEY` and `DD_APP_KEY` provided.\r\n\r\n## Who can review\r\n\r\nNeither @saliceti nor @paroxp","created_at":"2016-10-28T11:13:19Z","updated_at":"2016-10-28T15:04:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b8b3af5e42fbddf8e345f80d0d4b4fbd24605b1","assignee":{"login":"keymon","id":280032,"avatar_url":"https://avatars.githubusercontent.com/u/280032?v=3","gravatar_id":"","url":"https://api.github.com/users/keymon","html_url":"https://github.com/keymon","followers_url":"https://api.github.com/users/keymon/followers","following_url":"https://api.github.com/users/keymon/following{/other_user}","gists_url":"https://api.github.com/users/keymon/gists{/gist_id}","starred_url":"https://api.github.com/users/keymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keymon/subscriptions","organizations_url":"https://api.github.com/users/keymon/orgs","repos_url":"https://api.github.com/users/keymon/repos","events_url":"https://api.github.com/users/keymon/events{/privacy}","received_events_url":"https://api.github.com/users/keymon/received_events","type":"User","site_admin":false},"assignees":[{"login":"keymon","id":280032,"avatar_url":"https://avatars.githubusercontent.com/u/280032?v=3","gravatar_id":"","url":"https://api.github.com/users/keymon","html_url":"https://github.com/keymon","followers_url":"https://api.github.com/users/keymon/followers","following_url":"https://api.github.com/users/keymon/following{/other_user}","gists_url":"https://api.github.com/users/keymon/gists{/gist_id}","starred_url":"https://api.github.com/users/keymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keymon/subscriptions","organizations_url":"https://api.github.com/users/keymon/orgs","repos_url":"https://api.github.com/users/keymon/repos","events_url":"https://api.github.com/users/keymon/events{/privacy}","received_events_url":"https://api.github.com/users/keymon/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1/commits","review_comments_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1/comments","review_comment_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/1/comments","statuses_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/statuses/d48c5c55291bd5e1281089402dad11b1b758213d","head":{"label":"alphagov:127345741_ensure_notifications","ref":"127345741_ensure_notifications","sha":"d48c5c55291bd5e1281089402dad11b1b758213d","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":72097445,"name":"paas-cve-notifier","full_name":"alphagov/paas-cve-notifier","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/paas-cve-notifier","description":null,"fork":false,"url":"https://api.github.com/repos/alphagov/paas-cve-notifier","forks_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/forks","keys_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/events","assignees_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/merges","archive_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/deployments","created_at":"2016-10-27T10:27:01Z","updated_at":"2016-10-27T10:34:12Z","pushed_at":"2016-10-28T14:59:24Z","git_url":"git://github.com/alphagov/paas-cve-notifier.git","ssh_url":"git@github.com:alphagov/paas-cve-notifier.git","clone_url":"https://github.com/alphagov/paas-cve-notifier.git","svn_url":"https://github.com/alphagov/paas-cve-notifier","homepage":null,"size":29,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"21f6185066895e0d215a8dc7b07d33a0b2a6b1a3","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":72097445,"name":"paas-cve-notifier","full_name":"alphagov/paas-cve-notifier","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/paas-cve-notifier","description":null,"fork":false,"url":"https://api.github.com/repos/alphagov/paas-cve-notifier","forks_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/forks","keys_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/events","assignees_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/merges","archive_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-cve-notifier/deployments","created_at":"2016-10-27T10:27:01Z","updated_at":"2016-10-27T10:34:12Z","pushed_at":"2016-10-28T14:59:24Z","git_url":"git://github.com/alphagov/paas-cve-notifier.git","ssh_url":"git@github.com:alphagov/paas-cve-notifier.git","clone_url":"https://github.com/alphagov/paas-cve-notifier.git","svn_url":"https://github.com/alphagov/paas-cve-notifier","homepage":null,"size":29,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1"},"html":{"href":"https://github.com/alphagov/paas-cve-notifier/pull/1"},"issue":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/1"},"comments":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/paas-cve-notifier/statuses/d48c5c55291bd5e1281089402dad11b1b758213d"}}}}
{"actor":{"display_login":"keymon"}}