{"action":"created","issue":{"url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client/issues/1","repository_url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client","labels_url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client/issues/1/comments","events_url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client/issues/1/events","html_url":"https://github.com/andrew-blake/britishgas_myenergy_client/issues/1","id":163658377,"number":1,"title":"Json response from BG changed?","user":{"login":"vzorglub","id":19504096,"avatar_url":"https://avatars.githubusercontent.com/u/19504096?v=3","gravatar_id":"","url":"https://api.github.com/users/vzorglub","html_url":"https://github.com/vzorglub","followers_url":"https://api.github.com/users/vzorglub/followers","following_url":"https://api.github.com/users/vzorglub/following{/other_user}","gists_url":"https://api.github.com/users/vzorglub/gists{/gist_id}","starred_url":"https://api.github.com/users/vzorglub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vzorglub/subscriptions","organizations_url":"https://api.github.com/users/vzorglub/orgs","repos_url":"https://api.github.com/users/vzorglub/repos","events_url":"https://api.github.com/users/vzorglub/events{/privacy}","received_events_url":"https://api.github.com/users/vzorglub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-04T11:33:52Z","updated_at":"2016-10-17T18:46:10Z","closed_at":null,"body":"Hello after running the script I get:\r\n\r\npython download-usage.py\r\nINFO:urllib3.connectionpool:Starting new HTTPS connection (1): www.britishgas.co.uk\r\nsend: 'POST /mobile/iphone/OAMAuthenticate HTTP/1.1\\r\\nContent-Length: 161\\r\\nAccept-Language: en-GB;q=1, en;q=0.9, ja;q=0.8, el;q=0.7\\r\\nProxy-Connection: keep-alive\\r\\nConnection: keep-alive\\r\\nAccept: */*\\r\\nUser-Agent: British Gas/2.1.70 (iPod touch; iOS 8.1.2; Scale/2.00)\\r\\nHost: www.britishgas.co.uk\\r\\nCookie: SessionPersistence=CLICKSTREAMCLOUD:=visitorId=anonymous|PROFILEDATA:=avatar=/etc/designs/default/images/collab/avatar.png,isLoggedIn=true,isLoggedIn_xss=true,authorizableId=anonymous,authorizableId_xss=anonymous,formattedName=,formattedName_xss=|TAGCLOUD:=|SURFERINFO:=IP=127.0.0.1,keywords=,browser=WebKit,OS=Mac OS X,resolution=320x568|; homepage_beta=false; ecos.dt=1467630190000\\r\\nContent-Type: application/x-www-form-urlencoded\\r\\nAccept-Encoding: gzip, deflate\\r\\n\\r\\nusername=XXXXXXX%40gmail.com&deviceName=iPod+Touch&password=XXXXXX&clientVersion=6.1.7&responseType=JSON&iOSVersion=8.1.2&channel=itouch&deviceVersion=iPod5.1'\r\nreply: 'HTTP/1.1 200 OK\\r\\n'\r\nheader: Date: Mon, 04 Jul 2016 11:03:11 GMT\r\nheader: Server: Apache\r\nheader: X-Frame-Options: SAMEORIGIN\r\nheader: Set-Cookie: JSESSIONID=LlpjX6CPvqLRY58nzXydWVFndVkDSfyGpg4k50gfnJkbxvtzd2Rw!-884868058; path=/; HttpOnly\r\nheader: Set-Cookie: BG_COOKIE_ID=XFuGhV04692018141792615797194541; path=/; secure\r\nheader: X-Powered-By: Servlet/2.5 JSP/2.1\r\nheader: Vary: Accept-Encoding,User-Agent\r\nheader: Content-Encoding: gzip\r\nheader: Content-Length: 171\r\nheader: Keep-Alive: timeout=2, max=80\r\nheader: Connection: Keep-Alive\r\nheader: Content-Type: application/json\r\nDEBUG:urllib3.connectionpool:\"POST /mobile/iphone/OAMAuthenticate HTTP/1.1\" 200 171\r\nTraceback (most recent call last):\r\n  File \"download-usage.py\", line 8, in <module>\r\n    client = MyEnergyClient(username=USERNAME, password=PASSWORD, proxies=PROXIES, debug=DEBUG, ssl_verify=SSL_VERIFY)\r\n  File \"/opt/openhab/python/britishgas_myenergy_client.py\", line 65, in __init__\r\n    self._login()\r\n  File \"/opt/openhab/python/britishgas_myenergy_client.py\", line 129, in _login\r\n    self.account_number = self.response['OAMAuthenticate']['Accounts'][0]['AccountNumber']\r\nKeyError: 'Accounts'\r\n\r\nIf you suspect this is an IPython bug, please report it at:\r\n    https://github.com/ipython/ipython/issues\r\nor send an email to the mailing list at ipython-dev@scipy.org\r\n\r\nYou can print a more detailed traceback right now with \"%tb\", or use \"%debug\"\r\nto interactively debug it.\r\n\r\nExtra-detailed tracebacks for bug-reporting purposes can be enabled via:\r\n    %config Application.verbose_crash=True\r\n\r\n\r\nI believe that the Json response from BG has changed and therefore the key error\r\n\r\nWould you be able to investigate?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client/issues/comments/254296782","html_url":"https://github.com/andrew-blake/britishgas_myenergy_client/issues/1#issuecomment-254296782","issue_url":"https://api.github.com/repos/andrew-blake/britishgas_myenergy_client/issues/1","id":254296782,"user":{"login":"andrew-blake","id":1393000,"avatar_url":"https://avatars.githubusercontent.com/u/1393000?v=3","gravatar_id":"","url":"https://api.github.com/users/andrew-blake","html_url":"https://github.com/andrew-blake","followers_url":"https://api.github.com/users/andrew-blake/followers","following_url":"https://api.github.com/users/andrew-blake/following{/other_user}","gists_url":"https://api.github.com/users/andrew-blake/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew-blake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew-blake/subscriptions","organizations_url":"https://api.github.com/users/andrew-blake/orgs","repos_url":"https://api.github.com/users/andrew-blake/repos","events_url":"https://api.github.com/users/andrew-blake/events{/privacy}","received_events_url":"https://api.github.com/users/andrew-blake/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T18:46:10Z","updated_at":"2016-10-17T18:46:10Z","body":"Sorry - no. Not reached the top of the to-do list."}}
{"actor":{"display_login":"andrew-blake"}}