{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/iWeather_02/pulls/comments/165379185","pull_request_review_id":93307968,"id":165379185,"diff_hunk":"@@ -0,0 +1,148 @@\n+package com.framgia.music;\n+\n+import android.os.AsyncTask;\n+import com.framgia.music.model.Currently;\n+import com.framgia.music.model.DailyAndHourly;\n+import com.framgia.music.model.Humidity;\n+import com.framgia.music.model.LocationWeather;\n+import com.framgia.music.model.Temperature;\n+import com.framgia.music.model.TimeWeather;\n+import com.framgia.music.model.UvIndex;\n+import com.framgia.music.model.Visibility;\n+import com.framgia.music.model.Weather;\n+import com.framgia.music.model.WindSpeed;\n+import java.io.BufferedReader;\n+import java.io.IOException;\n+import java.io.InputStreamReader;\n+import java.net.HttpURLConnection;\n+import java.net.URL;\n+import java.util.ArrayList;\n+import org.json.JSONArray;\n+import org.json.JSONException;\n+import org.json.JSONObject;\n+\n+/**\n+ * Created by trong_tai on 01/02/2018.\n+ */\n+\n+public class FetchDataAsyncTask extends AsyncTask<String,LocationWeather,LocationWeather> {\n+\n+    private JSONObject mJsonObjectLocation = null;\n+    private LocationWeather mLocation = null;\n+    private OnFetchData mOnFetchData = null;\n+\n+    public FetchDataAsyncTask(OnFetchData onFetchData) {\n+        mOnFetchData = onFetchData;\n+    }\n+\n+    @Override\n+    protected void onPreExecute() {\n+        super.onPreExecute();\n+    }\n+\n+    @Override\n+    protected LocationWeather doInBackground(String... strings) {\n+        return  parseJsonObjectToLocationObject(strings[0]);\n+    }\n+\n+    @Override\n+    protected void onPostExecute(LocationWeather location) {\n+        super.onPostExecute(location);\n+        mOnFetchData.OnFetchDataSuccess(location);\n+    }\n+\n+    @Override\n+    protected void onProgressUpdate(LocationWeather... values) {\n+        super.onProgressUpdate(values);\n+    }\n+\n+    private String getJSONStringFromURL(String urlString) throws IOException, JSONException {\n+\n+        HttpURLConnection urlConnection = null;\n+\n+        URL url = new URL(urlString);\n+\n+        urlConnection = (HttpURLConnection) url.openConnection();\n+\n+        urlConnection.setRequestMethod(\"GET\");\n+        urlConnection.setReadTimeout(10000 /* milliseconds */);\n+        urlConnection.setConnectTimeout(15000 /* milliseconds */);\n+\n+        urlConnection.setDoOutput(true);\n+\n+        urlConnection.connect();\n+\n+        BufferedReader br=new BufferedReader(new InputStreamReader(url.openStream()));\n+\n+        StringBuilder sb = new StringBuilder();\n+        String line;\n+        while ((line = br.readLine()) != null) {\n+            sb.append(line+\"\\n\");\n+        }\n+        br.close();\n+\n+        String jsonString = sb.toString();\n+\n+        urlConnection.disconnect();\n+        return jsonString;\n+    }\n+\n+    private LocationWeather parseJsonObjectToLocationObject(String string){\n+        try {\n+            String mJson = getJSONStringFromURL(string);\n+            mJsonObjectLocation = new JSONObject(mJson);\n+\n+            JSONObject mJsonObjectCurrently = mJsonObjectLocation.getJSONObject(\"currently\");\n+            Currently mCurrently = new Currently(new Weather(mJsonObjectCurrently.getString(\"icon\"),\n+                    new Temperature(mJsonObjectCurrently.getString(\"temperature\"),\"\",\"\"),","path":"app/src/main/java/com/framgia/music/FetchDataAsyncTask.java","position":97,"original_position":97,"commit_id":"42c46ee2217f76aa9f3904391afe6a033a3d87b2","original_commit_id":"42c46ee2217f76aa9f3904391afe6a033a3d87b2","user":{"login":"le-quang-dao","id":6355989,"avatar_url":"https://avatars3.githubusercontent.com/u/6355989?v=4","gravatar_id":"","url":"https://api.github.com/users/le-quang-dao","html_url":"https://github.com/le-quang-dao","followers_url":"https://api.github.com/users/le-quang-dao/followers","following_url":"https://api.github.com/users/le-quang-dao/following{/other_user}","gists_url":"https://api.github.com/users/le-quang-dao/gists{/gist_id}","starred_url":"https://api.github.com/users/le-quang-dao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/le-quang-dao/subscriptions","organizations_url":"https://api.github.com/users/le-quang-dao/orgs","repos_url":"https://api.github.com/users/le-quang-dao/repos","events_url":"https://api.github.com/users/le-quang-dao/events{/privacy}","received_events_url":"https://api.github.com/users/le-quang-dao/received_events","type":"User","site_admin":false},"body":"ERROR: ',' is not followed by whitespace.","created_at":"2018-02-01T14:54:43Z","updated_at":"2018-02-01T14:54:43Z","html_url":"https://github.com/framgia/iWeather_02/pull/4#discussion_r165379185","pull_request_url":"https://api.github.com/repos/framgia/iWeather_02/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/framgia/iWeather_02/pulls/comments/165379185"},"html":{"href":"https://github.com/framgia/iWeather_02/pull/4#discussion_r165379185"},"pull_request":{"href":"https://api.github.com/repos/framgia/iWeather_02/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/iWeather_02/pulls/4","id":166556755,"html_url":"https://github.com/framgia/iWeather_02/pull/4","diff_url":"https://github.com/framgia/iWeather_02/pull/4.diff","patch_url":"https://github.com/framgia/iWeather_02/pull/4.patch","issue_url":"https://api.github.com/repos/framgia/iWeather_02/issues/4","number":4,"state":"open","locked":false,"title":"get api","user":{"login":"TRONGTAI1801","id":31733095,"avatar_url":"https://avatars3.githubusercontent.com/u/31733095?v=4","gravatar_id":"","url":"https://api.github.com/users/TRONGTAI1801","html_url":"https://github.com/TRONGTAI1801","followers_url":"https://api.github.com/users/TRONGTAI1801/followers","following_url":"https://api.github.com/users/TRONGTAI1801/following{/other_user}","gists_url":"https://api.github.com/users/TRONGTAI1801/gists{/gist_id}","starred_url":"https://api.github.com/users/TRONGTAI1801/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TRONGTAI1801/subscriptions","organizations_url":"https://api.github.com/users/TRONGTAI1801/orgs","repos_url":"https://api.github.com/users/TRONGTAI1801/repos","events_url":"https://api.github.com/users/TRONGTAI1801/events{/privacy}","received_events_url":"https://api.github.com/users/TRONGTAI1801/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-01T14:46:18Z","updated_at":"2018-02-01T14:54:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e6a9948f57d58cebeed43aa7d2d1ce2998816c1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/iWeather_02/pulls/4/commits","review_comments_url":"https://api.github.com/repos/framgia/iWeather_02/pulls/4/comments","review_comment_url":"https://api.github.com/repos/framgia/iWeather_02/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/iWeather_02/issues/4/comments","statuses_url":"https://api.github.com/repos/framgia/iWeather_02/statuses/42c46ee2217f76aa9f3904391afe6a033a3d87b2","head":{"label":"TRONGTAI1801:task_get_api","ref":"task_get_api","sha":"42c46ee2217f76aa9f3904391afe6a033a3d87b2","user":{"login":"TRONGTAI1801","id":31733095,"avatar_url":"https://avatars3.githubusercontent.com/u/31733095?v=4","gravatar_id":"","url":"https://api.github.com/users/TRONGTAI1801","html_url":"https://github.com/TRONGTAI1801","followers_url":"https://api.github.com/users/TRONGTAI1801/followers","following_url":"https://api.github.com/users/TRONGTAI1801/following{/other_user}","gists_url":"https://api.github.com/users/TRONGTAI1801/gists{/gist_id}","starred_url":"https://api.github.com/users/TRONGTAI1801/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TRONGTAI1801/subscriptions","organizations_url":"https://api.github.com/users/TRONGTAI1801/orgs","repos_url":"https://api.github.com/users/TRONGTAI1801/repos","events_url":"https://api.github.com/users/TRONGTAI1801/events{/privacy}","received_events_url":"https://api.github.com/users/TRONGTAI1801/received_events","type":"User","site_admin":false},"repo":{"id":118538046,"name":"iWeather_02","full_name":"TRONGTAI1801/iWeather_02","owner":{"login":"TRONGTAI1801","id":31733095,"avatar_url":"https://avatars3.githubusercontent.com/u/31733095?v=4","gravatar_id":"","url":"https://api.github.com/users/TRONGTAI1801","html_url":"https://github.com/TRONGTAI1801","followers_url":"https://api.github.com/users/TRONGTAI1801/followers","following_url":"https://api.github.com/users/TRONGTAI1801/following{/other_user}","gists_url":"https://api.github.com/users/TRONGTAI1801/gists{/gist_id}","starred_url":"https://api.github.com/users/TRONGTAI1801/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TRONGTAI1801/subscriptions","organizations_url":"https://api.github.com/users/TRONGTAI1801/orgs","repos_url":"https://api.github.com/users/TRONGTAI1801/repos","events_url":"https://api.github.com/users/TRONGTAI1801/events{/privacy}","received_events_url":"https://api.github.com/users/TRONGTAI1801/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TRONGTAI1801/iWeather_02","description":null,"fork":true,"url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02","forks_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/forks","keys_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/teams","hooks_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/hooks","issue_events_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/issues/events{/number}","events_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/events","assignees_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/assignees{/user}","branches_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/branches{/branch}","tags_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/tags","blobs_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/git/refs{/sha}","trees_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/statuses/{sha}","languages_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/languages","stargazers_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/stargazers","contributors_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/contributors","subscribers_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/subscribers","subscription_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/subscription","commits_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/commits{/sha}","git_commits_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/git/commits{/sha}","comments_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/comments{/number}","issue_comment_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/issues/comments{/number}","contents_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/contents/{+path}","compare_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/merges","archive_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/downloads","issues_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/issues{/number}","pulls_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/pulls{/number}","milestones_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/milestones{/number}","notifications_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/labels{/name}","releases_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/releases{/id}","deployments_url":"https://api.github.com/repos/TRONGTAI1801/iWeather_02/deployments","created_at":"2018-01-23T01:13:02Z","updated_at":"2018-01-23T01:13:04Z","pushed_at":"2018-02-01T14:45:07Z","git_url":"git://github.com/TRONGTAI1801/iWeather_02.git","ssh_url":"git@github.com:TRONGTAI1801/iWeather_02.git","clone_url":"https://github.com/TRONGTAI1801/iWeather_02.git","svn_url":"https://github.com/TRONGTAI1801/iWeather_02","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"framgia:develop","ref":"develop","sha":"0bb135af891693d42f71564bc372192fa8d06ce0","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":118388791,"name":"iWeather_02","full_name":"framgia/iWeather_02","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/iWeather_02","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/iWeather_02","forks_url":"https://api.github.com/repos/framgia/iWeather_02/forks","keys_url":"https://api.github.com/repos/framgia/iWeather_02/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/iWeather_02/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/iWeather_02/teams","hooks_url":"https://api.github.com/repos/framgia/iWeather_02/hooks","issue_events_url":"https://api.github.com/repos/framgia/iWeather_02/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/iWeather_02/events","assignees_url":"https://api.github.com/repos/framgia/iWeather_02/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/iWeather_02/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/iWeather_02/tags","blobs_url":"https://api.github.com/repos/framgia/iWeather_02/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/iWeather_02/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/iWeather_02/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/iWeather_02/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/iWeather_02/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/iWeather_02/languages","stargazers_url":"https://api.github.com/repos/framgia/iWeather_02/stargazers","contributors_url":"https://api.github.com/repos/framgia/iWeather_02/contributors","subscribers_url":"https://api.github.com/repos/framgia/iWeather_02/subscribers","subscription_url":"https://api.github.com/repos/framgia/iWeather_02/subscription","commits_url":"https://api.github.com/repos/framgia/iWeather_02/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/iWeather_02/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/iWeather_02/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/iWeather_02/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/iWeather_02/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/iWeather_02/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/iWeather_02/merges","archive_url":"https://api.github.com/repos/framgia/iWeather_02/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/iWeather_02/downloads","issues_url":"https://api.github.com/repos/framgia/iWeather_02/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/iWeather_02/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/iWeather_02/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/iWeather_02/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/iWeather_02/labels{/name}","releases_url":"https://api.github.com/repos/framgia/iWeather_02/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/iWeather_02/deployments","created_at":"2018-01-22T01:03:46Z","updated_at":"2018-01-30T00:44:08Z","pushed_at":"2018-02-01T14:46:19Z","git_url":"git://github.com/framgia/iWeather_02.git","ssh_url":"git@github.com:framgia/iWeather_02.git","clone_url":"https://github.com/framgia/iWeather_02.git","svn_url":"https://github.com/framgia/iWeather_02","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/iWeather_02/pulls/4"},"html":{"href":"https://github.com/framgia/iWeather_02/pull/4"},"issue":{"href":"https://api.github.com/repos/framgia/iWeather_02/issues/4"},"comments":{"href":"https://api.github.com/repos/framgia/iWeather_02/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/iWeather_02/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/iWeather_02/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/iWeather_02/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/iWeather_02/statuses/42c46ee2217f76aa9f3904391afe6a033a3d87b2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"le-quang-dao"}}