{"action":"created","comment":{"url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/comments/30606491","id":30606491,"diff_hunk":"@@ -341,6 +341,38 @@ function display_search_form ( $alert, $details = array(), $errors = array() ) {\n             echo '<em class=\"error\">You have used a comma in your search term &ndash; are you sure this is what you want?\n You cannot sign up to multiple search terms using a comma &ndash; either use OR, or fill in this form multiple times.</em>';\n         }\n+        if ( preg_match('#([A-Z]{1,2}\\d+ ?\\d[A-Z]{2})#i', $alertsearch, $m) && strlen($alertsearch) > strlen($m[1]) && validate_postcode($m[1]) ) {\n+            $scottish_text = '';\n+            $mp_display_text = '';\n+            if (postcode_is_scottish($m[1])) {\n+                $mp_display_text = 'your MP, ';\n+                $scottish_text = ' or MSP';\n+            }","path":"www/docs/alert/index.php","position":10,"original_position":10,"commit_id":"abcbfaf6aa2fe4e48b1372318f694e54517c3299","original_commit_id":"abcbfaf6aa2fe4e48b1372318f694e54517c3299","user":{"login":"dracos","id":154364,"avatar_url":"https://avatars.githubusercontent.com/u/154364?v=3","gravatar_id":"","url":"https://api.github.com/users/dracos","html_url":"https://github.com/dracos","followers_url":"https://api.github.com/users/dracos/followers","following_url":"https://api.github.com/users/dracos/following{/other_user}","gists_url":"https://api.github.com/users/dracos/gists{/gist_id}","starred_url":"https://api.github.com/users/dracos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dracos/subscriptions","organizations_url":"https://api.github.com/users/dracos/orgs","repos_url":"https://api.github.com/users/dracos/repos","events_url":"https://api.github.com/users/dracos/events{/privacy}","received_events_url":"https://api.github.com/users/dracos/received_events","type":"User","site_admin":false},"body":"Though of course you have multiple MLAs for a postcode, don't you. I guess it could sign up for any of them saying the thing?","created_at":"2015-05-19T14:45:53Z","updated_at":"2015-05-19T14:45:53Z","html_url":"https://github.com/mysociety/theyworkforyou/pull/863#discussion_r30606491","pull_request_url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863","_links":{"self":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/comments/30606491"},"html":{"href":"https://github.com/mysociety/theyworkforyou/pull/863#discussion_r30606491"},"pull_request":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863"}}},"pull_request":{"url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863","id":35616258,"html_url":"https://github.com/mysociety/theyworkforyou/pull/863","diff_url":"https://github.com/mysociety/theyworkforyou/pull/863.diff","patch_url":"https://github.com/mysociety/theyworkforyou/pull/863.patch","issue_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues/863","number":863,"state":"open","locked":false,"title":"detect signups for postcodes with a keyword and advise user","user":{"login":"struan","id":5310,"avatar_url":"https://avatars.githubusercontent.com/u/5310?v=3","gravatar_id":"","url":"https://api.github.com/users/struan","html_url":"https://github.com/struan","followers_url":"https://api.github.com/users/struan/followers","following_url":"https://api.github.com/users/struan/following{/other_user}","gists_url":"https://api.github.com/users/struan/gists{/gist_id}","starred_url":"https://api.github.com/users/struan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/struan/subscriptions","organizations_url":"https://api.github.com/users/struan/orgs","repos_url":"https://api.github.com/users/struan/repos","events_url":"https://api.github.com/users/struan/events{/privacy}","received_events_url":"https://api.github.com/users/struan/received_events","type":"User","site_admin":false},"body":"If someone is signing up for and alert that is of the form\r\n\r\n    ZZ1 1AA elephants\r\n\r\nthen it's likely they actually want to sign up for the MP for that\r\npostcode mentioning elephants so put in a notice to this effect and also\r\na button to enable them to subscribe to an alert for that.\r\n\r\npart of #593","created_at":"2015-05-18T09:32:47Z","updated_at":"2015-05-19T14:45:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1ee7d4f425dfb03917ef42340606ec857cfaf33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863/commits","review_comments_url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863/comments","review_comment_url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues/863/comments","statuses_url":"https://api.github.com/repos/mysociety/theyworkforyou/statuses/abcbfaf6aa2fe4e48b1372318f694e54517c3299","head":{"label":"mysociety:issues/593-detect-postcode-keyword-alert-signups","ref":"issues/593-detect-postcode-keyword-alert-signups","sha":"abcbfaf6aa2fe4e48b1372318f694e54517c3299","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":500795,"name":"theyworkforyou","full_name":"mysociety/theyworkforyou","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/theyworkforyou","description":"Keeping tabs on the UK's parliaments and assemblies","fork":false,"url":"https://api.github.com/repos/mysociety/theyworkforyou","forks_url":"https://api.github.com/repos/mysociety/theyworkforyou/forks","keys_url":"https://api.github.com/repos/mysociety/theyworkforyou/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/theyworkforyou/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/theyworkforyou/teams","hooks_url":"https://api.github.com/repos/mysociety/theyworkforyou/hooks","issue_events_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/theyworkforyou/events","assignees_url":"https://api.github.com/repos/mysociety/theyworkforyou/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/theyworkforyou/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/theyworkforyou/tags","blobs_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/theyworkforyou/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/theyworkforyou/languages","stargazers_url":"https://api.github.com/repos/mysociety/theyworkforyou/stargazers","contributors_url":"https://api.github.com/repos/mysociety/theyworkforyou/contributors","subscribers_url":"https://api.github.com/repos/mysociety/theyworkforyou/subscribers","subscription_url":"https://api.github.com/repos/mysociety/theyworkforyou/subscription","commits_url":"https://api.github.com/repos/mysociety/theyworkforyou/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/theyworkforyou/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/theyworkforyou/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/theyworkforyou/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/theyworkforyou/merges","archive_url":"https://api.github.com/repos/mysociety/theyworkforyou/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/theyworkforyou/downloads","issues_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/theyworkforyou/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/theyworkforyou/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/theyworkforyou/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/theyworkforyou/releases{/id}","created_at":"2010-02-03T15:22:29Z","updated_at":"2015-05-14T13:02:16Z","pushed_at":"2015-05-19T13:29:33Z","git_url":"git://github.com/mysociety/theyworkforyou.git","ssh_url":"git@github.com:mysociety/theyworkforyou.git","clone_url":"https://github.com/mysociety/theyworkforyou.git","svn_url":"https://github.com/mysociety/theyworkforyou","homepage":"http://www.theyworkforyou.com/","size":105209,"stargazers_count":60,"watchers_count":60,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":350,"forks":22,"open_issues":350,"watchers":60,"default_branch":"master"}},"base":{"label":"mysociety:master","ref":"master","sha":"742b40d54a31db493b2ab6a49a321649d06ae898","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":500795,"name":"theyworkforyou","full_name":"mysociety/theyworkforyou","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/theyworkforyou","description":"Keeping tabs on the UK's parliaments and assemblies","fork":false,"url":"https://api.github.com/repos/mysociety/theyworkforyou","forks_url":"https://api.github.com/repos/mysociety/theyworkforyou/forks","keys_url":"https://api.github.com/repos/mysociety/theyworkforyou/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/theyworkforyou/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/theyworkforyou/teams","hooks_url":"https://api.github.com/repos/mysociety/theyworkforyou/hooks","issue_events_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/theyworkforyou/events","assignees_url":"https://api.github.com/repos/mysociety/theyworkforyou/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/theyworkforyou/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/theyworkforyou/tags","blobs_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/theyworkforyou/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/theyworkforyou/languages","stargazers_url":"https://api.github.com/repos/mysociety/theyworkforyou/stargazers","contributors_url":"https://api.github.com/repos/mysociety/theyworkforyou/contributors","subscribers_url":"https://api.github.com/repos/mysociety/theyworkforyou/subscribers","subscription_url":"https://api.github.com/repos/mysociety/theyworkforyou/subscription","commits_url":"https://api.github.com/repos/mysociety/theyworkforyou/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/theyworkforyou/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/theyworkforyou/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/theyworkforyou/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/theyworkforyou/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/theyworkforyou/merges","archive_url":"https://api.github.com/repos/mysociety/theyworkforyou/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/theyworkforyou/downloads","issues_url":"https://api.github.com/repos/mysociety/theyworkforyou/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/theyworkforyou/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/theyworkforyou/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/theyworkforyou/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/theyworkforyou/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/theyworkforyou/releases{/id}","created_at":"2010-02-03T15:22:29Z","updated_at":"2015-05-14T13:02:16Z","pushed_at":"2015-05-19T13:29:33Z","git_url":"git://github.com/mysociety/theyworkforyou.git","ssh_url":"git@github.com:mysociety/theyworkforyou.git","clone_url":"https://github.com/mysociety/theyworkforyou.git","svn_url":"https://github.com/mysociety/theyworkforyou","homepage":"http://www.theyworkforyou.com/","size":105209,"stargazers_count":60,"watchers_count":60,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":350,"forks":22,"open_issues":350,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863"},"html":{"href":"https://github.com/mysociety/theyworkforyou/pull/863"},"issue":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/issues/863"},"comments":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/issues/863/comments"},"review_comments":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863/comments"},"review_comment":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/pulls/863/commits"},"statuses":{"href":"https://api.github.com/repos/mysociety/theyworkforyou/statuses/abcbfaf6aa2fe4e48b1372318f694e54517c3299"}}}}