{"action":"opened","number":84,"pull_request":{"url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/84","id":88399146,"html_url":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/pull/84","diff_url":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/pull/84.diff","patch_url":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/pull/84.patch","issue_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues/84","number":84,"state":"open","locked":false,"title":"Add support to get current weather for a group of city ids","user":{"login":"tardypad","id":6368493,"avatar_url":"https://avatars.githubusercontent.com/u/6368493?v=3","gravatar_id":"","url":"https://api.github.com/users/tardypad","html_url":"https://github.com/tardypad","followers_url":"https://api.github.com/users/tardypad/followers","following_url":"https://api.github.com/users/tardypad/following{/other_user}","gists_url":"https://api.github.com/users/tardypad/gists{/gist_id}","starred_url":"https://api.github.com/users/tardypad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardypad/subscriptions","organizations_url":"https://api.github.com/users/tardypad/orgs","repos_url":"https://api.github.com/users/tardypad/repos","events_url":"https://api.github.com/users/tardypad/events{/privacy}","received_events_url":"https://api.github.com/users/tardypad/received_events","type":"User","site_admin":false},"body":"This adds support for http://openweathermap.org/current#severalid\r\n\r\nI've tried in the code to follow the general structure used for every webservice (`getWeatherGroup`, `getRawWeatherGroupData`, ...)\r\nand to keep consistency wherever possible (`CurrentWeatherGroup` implements `Iterator`, reuse of the `CurrentWeather` class,...)\r\n\r\nHowever, there are a few differences.\r\n\r\nFirst of all, this webservice only supports a JSON response format.\r\nSo  I've added a small `parseJson` function for it, and omit the ` $mode` parameter in `getRawWeatherGroupData`\r\n\r\nThe second point is that I wanted to reuse the `CurrentWeather` class for consistency.\r\nSince the constructor was explicitly expecting an `SimpleXMLElement` object, I had to make a small \"tricky\" change for it to accept as well a `stdClass` coming from the JSON parsing\r\nThis is not ideal in my view, but I feel that too many other structural changes (more than I have time for now) would have been needed to make this better.\r\n\r\nThe last point is that the response structures from OpenWeatherMap are not consistent between JSON and XML:\r\n- some unit fields present in the XML are missing in the JSON one\r\n- the rain part (called precipitation in the XML...) is not always present and its unit varies between '1h' and '3h' from what I saw\r\nI've managed this the best I could\r\n\r\nBut in the end, it seems to work fine :)","created_at":"2016-10-07T08:32:32Z","updated_at":"2016-10-07T08:32:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1641bf8ebf183e60705b045aaa9e888a2ba6ac4b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/84/commits","review_comments_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/84/comments","review_comment_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues/84/comments","statuses_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/statuses/5458e0c4458459667269ed75426a963967a43b88","head":{"label":"M2Mobi:group_weather","ref":"group_weather","sha":"5458e0c4458459667269ed75426a963967a43b88","user":{"login":"M2Mobi","id":2591381,"avatar_url":"https://avatars.githubusercontent.com/u/2591381?v=3","gravatar_id":"","url":"https://api.github.com/users/M2Mobi","html_url":"https://github.com/M2Mobi","followers_url":"https://api.github.com/users/M2Mobi/followers","following_url":"https://api.github.com/users/M2Mobi/following{/other_user}","gists_url":"https://api.github.com/users/M2Mobi/gists{/gist_id}","starred_url":"https://api.github.com/users/M2Mobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M2Mobi/subscriptions","organizations_url":"https://api.github.com/users/M2Mobi/orgs","repos_url":"https://api.github.com/users/M2Mobi/repos","events_url":"https://api.github.com/users/M2Mobi/events{/privacy}","received_events_url":"https://api.github.com/users/M2Mobi/received_events","type":"Organization","site_admin":false},"repo":{"id":69961638,"name":"OpenWeatherMap-PHP-Api","full_name":"M2Mobi/OpenWeatherMap-PHP-Api","owner":{"login":"M2Mobi","id":2591381,"avatar_url":"https://avatars.githubusercontent.com/u/2591381?v=3","gravatar_id":"","url":"https://api.github.com/users/M2Mobi","html_url":"https://github.com/M2Mobi","followers_url":"https://api.github.com/users/M2Mobi/followers","following_url":"https://api.github.com/users/M2Mobi/following{/other_user}","gists_url":"https://api.github.com/users/M2Mobi/gists{/gist_id}","starred_url":"https://api.github.com/users/M2Mobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M2Mobi/subscriptions","organizations_url":"https://api.github.com/users/M2Mobi/orgs","repos_url":"https://api.github.com/users/M2Mobi/repos","events_url":"https://api.github.com/users/M2Mobi/events{/privacy}","received_events_url":"https://api.github.com/users/M2Mobi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/M2Mobi/OpenWeatherMap-PHP-Api","description":"A PHP API to parse weather data and weather history from OpenWeatherMap.org.","fork":true,"url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api","forks_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/forks","keys_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/teams","hooks_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/hooks","issue_events_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/issues/events{/number}","events_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/events","assignees_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/assignees{/user}","branches_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/branches{/branch}","tags_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/tags","blobs_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/git/refs{/sha}","trees_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/statuses/{sha}","languages_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/languages","stargazers_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/stargazers","contributors_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/contributors","subscribers_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/subscribers","subscription_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/subscription","commits_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/commits{/sha}","git_commits_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/git/commits{/sha}","comments_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/comments{/number}","issue_comment_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/issues/comments{/number}","contents_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/contents/{+path}","compare_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/merges","archive_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/downloads","issues_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/issues{/number}","pulls_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/pulls{/number}","milestones_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/milestones{/number}","notifications_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/labels{/name}","releases_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/releases{/id}","deployments_url":"https://api.github.com/repos/M2Mobi/OpenWeatherMap-PHP-Api/deployments","created_at":"2016-10-04T12:13:16Z","updated_at":"2016-10-04T12:13:17Z","pushed_at":"2016-10-06T15:26:07Z","git_url":"git://github.com/M2Mobi/OpenWeatherMap-PHP-Api.git","ssh_url":"git@github.com:M2Mobi/OpenWeatherMap-PHP-Api.git","clone_url":"https://github.com/M2Mobi/OpenWeatherMap-PHP-Api.git","svn_url":"https://github.com/M2Mobi/OpenWeatherMap-PHP-Api","homepage":"http://OpenWeatherMap.org","size":867,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cmfcmf:master","ref":"master","sha":"c3530d7278bdab3a8f8b7d137d7685c7f6eff73e","user":{"login":"cmfcmf","id":2145092,"avatar_url":"https://avatars.githubusercontent.com/u/2145092?v=3","gravatar_id":"","url":"https://api.github.com/users/cmfcmf","html_url":"https://github.com/cmfcmf","followers_url":"https://api.github.com/users/cmfcmf/followers","following_url":"https://api.github.com/users/cmfcmf/following{/other_user}","gists_url":"https://api.github.com/users/cmfcmf/gists{/gist_id}","starred_url":"https://api.github.com/users/cmfcmf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmfcmf/subscriptions","organizations_url":"https://api.github.com/users/cmfcmf/orgs","repos_url":"https://api.github.com/users/cmfcmf/repos","events_url":"https://api.github.com/users/cmfcmf/events{/privacy}","received_events_url":"https://api.github.com/users/cmfcmf/received_events","type":"User","site_admin":false},"repo":{"id":11002692,"name":"OpenWeatherMap-PHP-Api","full_name":"cmfcmf/OpenWeatherMap-PHP-Api","owner":{"login":"cmfcmf","id":2145092,"avatar_url":"https://avatars.githubusercontent.com/u/2145092?v=3","gravatar_id":"","url":"https://api.github.com/users/cmfcmf","html_url":"https://github.com/cmfcmf","followers_url":"https://api.github.com/users/cmfcmf/followers","following_url":"https://api.github.com/users/cmfcmf/following{/other_user}","gists_url":"https://api.github.com/users/cmfcmf/gists{/gist_id}","starred_url":"https://api.github.com/users/cmfcmf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmfcmf/subscriptions","organizations_url":"https://api.github.com/users/cmfcmf/orgs","repos_url":"https://api.github.com/users/cmfcmf/repos","events_url":"https://api.github.com/users/cmfcmf/events{/privacy}","received_events_url":"https://api.github.com/users/cmfcmf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api","description":"A PHP API to parse weather data and weather history from OpenWeatherMap.org.","fork":false,"url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api","forks_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/forks","keys_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/teams","hooks_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/hooks","issue_events_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues/events{/number}","events_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/events","assignees_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/assignees{/user}","branches_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/branches{/branch}","tags_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/tags","blobs_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/statuses/{sha}","languages_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/languages","stargazers_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/stargazers","contributors_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/contributors","subscribers_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/subscribers","subscription_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/subscription","commits_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/contents/{+path}","compare_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/merges","archive_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/downloads","issues_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues{/number}","pulls_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls{/number}","milestones_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/milestones{/number}","notifications_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/labels{/name}","releases_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/releases{/id}","deployments_url":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/deployments","created_at":"2013-06-27T16:58:13Z","updated_at":"2016-10-03T16:32:19Z","pushed_at":"2016-10-07T08:32:32Z","git_url":"git://github.com/cmfcmf/OpenWeatherMap-PHP-Api.git","ssh_url":"git@github.com:cmfcmf/OpenWeatherMap-PHP-Api.git","clone_url":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api.git","svn_url":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api","homepage":"http://OpenWeatherMap.org","size":1433,"stargazers_count":152,"watchers_count":152,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":6,"forks":47,"open_issues":6,"watchers":152,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/84"},"html":{"href":"https://github.com/cmfcmf/OpenWeatherMap-PHP-Api/pull/84"},"issue":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues/84"},"comments":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/cmfcmf/OpenWeatherMap-PHP-Api/statuses/5458e0c4458459667269ed75426a963967a43b88"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":204,"deletions":15,"changed_files":3}}
{"actor":{"display_login":"tardypad"}}