{"action":"created","issue":{"url":"https://api.github.com/repos/MrSwitch/hello.js/issues/297","labels_url":"https://api.github.com/repos/MrSwitch/hello.js/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/MrSwitch/hello.js/issues/297/comments","events_url":"https://api.github.com/repos/MrSwitch/hello.js/issues/297/events","html_url":"https://github.com/MrSwitch/hello.js/issues/297","id":98067743,"number":297,"title":"Amazon Module","user":{"login":"HynesIP","id":1254442,"avatar_url":"https://avatars.githubusercontent.com/u/1254442?v=3","gravatar_id":"","url":"https://api.github.com/users/HynesIP","html_url":"https://github.com/HynesIP","followers_url":"https://api.github.com/users/HynesIP/followers","following_url":"https://api.github.com/users/HynesIP/following{/other_user}","gists_url":"https://api.github.com/users/HynesIP/gists{/gist_id}","starred_url":"https://api.github.com/users/HynesIP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HynesIP/subscriptions","organizations_url":"https://api.github.com/users/HynesIP/orgs","repos_url":"https://api.github.com/users/HynesIP/repos","events_url":"https://api.github.com/users/HynesIP/events{/privacy}","received_events_url":"https://api.github.com/users/HynesIP/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-30T01:52:07Z","updated_at":"2015-08-20T06:44:32Z","closed_at":null,"body":"I just noticed the latest and greatest has an issue with decoding the Amazon p.state. I've been using a major kludge for a few months that someone else might be able to improve on.\r\n\r\n```\r\n\t\tvar pState;\r\n\t\t// If p.state\r\n\t\tif (p && 'state' in p) {\r\n\t\t\tvar isAmazon = p.state.match(\"amazon\"); // p was returning p.network\r\n\t\t\tif(isAmazon){\r\n\t\t\t    pState = decodeURIComponent(escape(p.state)),\r\n\t\t\t    pState = pState.replace(/&#34;/g, \"\\\"\");\r\n\t\t\t}else{\r\n\t\t\t\tpState = p.state;\r\n\t\t\t}\r\n\t\t\t// Remove any addition information\r\n\t\t\t// E.g. p.state = 'facebook.page';\r\n\t\t\ttry {\r\n\t\t\t\tvar a = JSON.parse(pState);\r\n\t\t\t\t_this.extend(p, a);\r\n\t\t\t}\r\n\t\t\tcatch (e) {\r\n\t\t\t\tconsole.error('Could not decode state parameter');\r\n\t\t\t}\r\n```\r\nIt's ugly, but it works. \r\n\r\nVK works great, BTW."},"comment":{"url":"https://api.github.com/repos/MrSwitch/hello.js/issues/comments/132908948","html_url":"https://github.com/MrSwitch/hello.js/issues/297#issuecomment-132908948","issue_url":"https://api.github.com/repos/MrSwitch/hello.js/issues/297","id":132908948,"user":{"login":"MrSwitch","id":947163,"avatar_url":"https://avatars.githubusercontent.com/u/947163?v=3","gravatar_id":"","url":"https://api.github.com/users/MrSwitch","html_url":"https://github.com/MrSwitch","followers_url":"https://api.github.com/users/MrSwitch/followers","following_url":"https://api.github.com/users/MrSwitch/following{/other_user}","gists_url":"https://api.github.com/users/MrSwitch/gists{/gist_id}","starred_url":"https://api.github.com/users/MrSwitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrSwitch/subscriptions","organizations_url":"https://api.github.com/users/MrSwitch/orgs","repos_url":"https://api.github.com/users/MrSwitch/repos","events_url":"https://api.github.com/users/MrSwitch/events{/privacy}","received_events_url":"https://api.github.com/users/MrSwitch/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T06:44:32Z","updated_at":"2015-08-20T06:44:32Z","body":"Hi, @HynesIP that is pretty ugly. Have you improved upon it at all since?"}}