{"action":"created","comment":{"url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/comments/30254416","id":30254416,"diff_hunk":"@@ -27,8 +31,24 @@ Pebble.addEventListener(\"appmessage\", function(e) {\n });\n \n function downloadBinaryResource(imageURL, callback, errorCallback) {\n+\n+\n+    /*POSTing the image URL to the server for conversion.\n+      This conversion is only for Pebble Time. On a original\n+      Pebble the dithering should convert the image to have \n+      to 2 colors*/\n+    var req1 = new XMLHttpRequest();\n+    req1.open(\"POST\",toServer, true);\n+    imageURL = \"imageurl=\" + imageURL;\n+    req1.setRequestHeader(\"Content-type\", \"imageURL\");\n+    req1.setRequestHeader(\"Content-length\", imageURL.length);\n+    req1.setRequestHeader(\"Connection\", \"close\");    \n+    req1.send(imageURL);","path":"src/js/pebble-js-app.js","position":26,"original_position":26,"commit_id":"3ead5b84dc4b9ae529c7234af25bfc425fa6f955","original_commit_id":"3ead5b84dc4b9ae529c7234af25bfc425fa6f955","user":{"login":"Redshift9","id":10281426,"avatar_url":"https://avatars.githubusercontent.com/u/10281426?v=3","gravatar_id":"","url":"https://api.github.com/users/Redshift9","html_url":"https://github.com/Redshift9","followers_url":"https://api.github.com/users/Redshift9/followers","following_url":"https://api.github.com/users/Redshift9/following{/other_user}","gists_url":"https://api.github.com/users/Redshift9/gists{/gist_id}","starred_url":"https://api.github.com/users/Redshift9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redshift9/subscriptions","organizations_url":"https://api.github.com/users/Redshift9/orgs","repos_url":"https://api.github.com/users/Redshift9/repos","events_url":"https://api.github.com/users/Redshift9/events{/privacy}","received_events_url":"https://api.github.com/users/Redshift9/received_events","type":"User","site_admin":false},"body":"I converted the POST request to a synchronous request (changed third parameter of req1.open to false). So it waits for the post to complete and receive a response before progressing.","created_at":"2015-05-13T17:31:01Z","updated_at":"2015-05-13T17:31:01Z","html_url":"https://github.com/pebble-examples/pebble-faces/pull/15#discussion_r30254416","pull_request_url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/comments/30254416"},"html":{"href":"https://github.com/pebble-examples/pebble-faces/pull/15#discussion_r30254416"},"pull_request":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15","id":35282227,"html_url":"https://github.com/pebble-examples/pebble-faces/pull/15","diff_url":"https://github.com/pebble-examples/pebble-faces/pull/15.diff","patch_url":"https://github.com/pebble-examples/pebble-faces/pull/15.patch","issue_url":"https://api.github.com/repos/pebble-examples/pebble-faces/issues/15","number":15,"state":"open","locked":false,"title":"Server side conversion scripts","user":{"login":"Redshift9","id":10281426,"avatar_url":"https://avatars.githubusercontent.com/u/10281426?v=3","gravatar_id":"","url":"https://api.github.com/users/Redshift9","html_url":"https://github.com/Redshift9","followers_url":"https://api.github.com/users/Redshift9/followers","following_url":"https://api.github.com/users/Redshift9/following{/other_user}","gists_url":"https://api.github.com/users/Redshift9/gists{/gist_id}","starred_url":"https://api.github.com/users/Redshift9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redshift9/subscriptions","organizations_url":"https://api.github.com/users/Redshift9/orgs","repos_url":"https://api.github.com/users/Redshift9/repos","events_url":"https://api.github.com/users/Redshift9/events{/privacy}","received_events_url":"https://api.github.com/users/Redshift9/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-12T23:44:48Z","updated_at":"2015-05-13T17:31:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b26b283e9126e63af30ddd6e0d3ec0af841e6760","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15/commits","review_comments_url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15/comments","review_comment_url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pebble-examples/pebble-faces/issues/15/comments","statuses_url":"https://api.github.com/repos/pebble-examples/pebble-faces/statuses/3ead5b84dc4b9ae529c7234af25bfc425fa6f955","head":{"label":"Redshift9:master","ref":"master","sha":"3ead5b84dc4b9ae529c7234af25bfc425fa6f955","user":{"login":"Redshift9","id":10281426,"avatar_url":"https://avatars.githubusercontent.com/u/10281426?v=3","gravatar_id":"","url":"https://api.github.com/users/Redshift9","html_url":"https://github.com/Redshift9","followers_url":"https://api.github.com/users/Redshift9/followers","following_url":"https://api.github.com/users/Redshift9/following{/other_user}","gists_url":"https://api.github.com/users/Redshift9/gists{/gist_id}","starred_url":"https://api.github.com/users/Redshift9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redshift9/subscriptions","organizations_url":"https://api.github.com/users/Redshift9/orgs","repos_url":"https://api.github.com/users/Redshift9/repos","events_url":"https://api.github.com/users/Redshift9/events{/privacy}","received_events_url":"https://api.github.com/users/Redshift9/received_events","type":"User","site_admin":false},"repo":{"id":35173633,"name":"pebble-faces","full_name":"Redshift9/pebble-faces","owner":{"login":"Redshift9","id":10281426,"avatar_url":"https://avatars.githubusercontent.com/u/10281426?v=3","gravatar_id":"","url":"https://api.github.com/users/Redshift9","html_url":"https://github.com/Redshift9","followers_url":"https://api.github.com/users/Redshift9/followers","following_url":"https://api.github.com/users/Redshift9/following{/other_user}","gists_url":"https://api.github.com/users/Redshift9/gists{/gist_id}","starred_url":"https://api.github.com/users/Redshift9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redshift9/subscriptions","organizations_url":"https://api.github.com/users/Redshift9/orgs","repos_url":"https://api.github.com/users/Redshift9/repos","events_url":"https://api.github.com/users/Redshift9/events{/privacy}","received_events_url":"https://api.github.com/users/Redshift9/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Redshift9/pebble-faces","description":"A simple app that shows how to fetch PBI images from the internet and display them on Pebble (with PebbleKit JavaScript)","fork":true,"url":"https://api.github.com/repos/Redshift9/pebble-faces","forks_url":"https://api.github.com/repos/Redshift9/pebble-faces/forks","keys_url":"https://api.github.com/repos/Redshift9/pebble-faces/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Redshift9/pebble-faces/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Redshift9/pebble-faces/teams","hooks_url":"https://api.github.com/repos/Redshift9/pebble-faces/hooks","issue_events_url":"https://api.github.com/repos/Redshift9/pebble-faces/issues/events{/number}","events_url":"https://api.github.com/repos/Redshift9/pebble-faces/events","assignees_url":"https://api.github.com/repos/Redshift9/pebble-faces/assignees{/user}","branches_url":"https://api.github.com/repos/Redshift9/pebble-faces/branches{/branch}","tags_url":"https://api.github.com/repos/Redshift9/pebble-faces/tags","blobs_url":"https://api.github.com/repos/Redshift9/pebble-faces/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Redshift9/pebble-faces/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Redshift9/pebble-faces/git/refs{/sha}","trees_url":"https://api.github.com/repos/Redshift9/pebble-faces/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Redshift9/pebble-faces/statuses/{sha}","languages_url":"https://api.github.com/repos/Redshift9/pebble-faces/languages","stargazers_url":"https://api.github.com/repos/Redshift9/pebble-faces/stargazers","contributors_url":"https://api.github.com/repos/Redshift9/pebble-faces/contributors","subscribers_url":"https://api.github.com/repos/Redshift9/pebble-faces/subscribers","subscription_url":"https://api.github.com/repos/Redshift9/pebble-faces/subscription","commits_url":"https://api.github.com/repos/Redshift9/pebble-faces/commits{/sha}","git_commits_url":"https://api.github.com/repos/Redshift9/pebble-faces/git/commits{/sha}","comments_url":"https://api.github.com/repos/Redshift9/pebble-faces/comments{/number}","issue_comment_url":"https://api.github.com/repos/Redshift9/pebble-faces/issues/comments{/number}","contents_url":"https://api.github.com/repos/Redshift9/pebble-faces/contents/{+path}","compare_url":"https://api.github.com/repos/Redshift9/pebble-faces/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Redshift9/pebble-faces/merges","archive_url":"https://api.github.com/repos/Redshift9/pebble-faces/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Redshift9/pebble-faces/downloads","issues_url":"https://api.github.com/repos/Redshift9/pebble-faces/issues{/number}","pulls_url":"https://api.github.com/repos/Redshift9/pebble-faces/pulls{/number}","milestones_url":"https://api.github.com/repos/Redshift9/pebble-faces/milestones{/number}","notifications_url":"https://api.github.com/repos/Redshift9/pebble-faces/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Redshift9/pebble-faces/labels{/name}","releases_url":"https://api.github.com/repos/Redshift9/pebble-faces/releases{/id}","created_at":"2015-05-06T17:41:36Z","updated_at":"2015-05-06T17:41:37Z","pushed_at":"2015-05-12T23:50:00Z","git_url":"git://github.com/Redshift9/pebble-faces.git","ssh_url":"git@github.com:Redshift9/pebble-faces.git","clone_url":"https://github.com/Redshift9/pebble-faces.git","svn_url":"https://github.com/Redshift9/pebble-faces","homepage":null,"size":92,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"pebble-examples:master","ref":"master","sha":"6c63ae2d5d2d78fc7d5e02ccfb6e1941f036c0ad","user":{"login":"pebble-examples","id":8129119,"avatar_url":"https://avatars.githubusercontent.com/u/8129119?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble-examples","html_url":"https://github.com/pebble-examples","followers_url":"https://api.github.com/users/pebble-examples/followers","following_url":"https://api.github.com/users/pebble-examples/following{/other_user}","gists_url":"https://api.github.com/users/pebble-examples/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble-examples/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble-examples/subscriptions","organizations_url":"https://api.github.com/users/pebble-examples/orgs","repos_url":"https://api.github.com/users/pebble-examples/repos","events_url":"https://api.github.com/users/pebble-examples/events{/privacy}","received_events_url":"https://api.github.com/users/pebble-examples/received_events","type":"Organization","site_admin":false},"repo":{"id":14628020,"name":"pebble-faces","full_name":"pebble-examples/pebble-faces","owner":{"login":"pebble-examples","id":8129119,"avatar_url":"https://avatars.githubusercontent.com/u/8129119?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble-examples","html_url":"https://github.com/pebble-examples","followers_url":"https://api.github.com/users/pebble-examples/followers","following_url":"https://api.github.com/users/pebble-examples/following{/other_user}","gists_url":"https://api.github.com/users/pebble-examples/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble-examples/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble-examples/subscriptions","organizations_url":"https://api.github.com/users/pebble-examples/orgs","repos_url":"https://api.github.com/users/pebble-examples/repos","events_url":"https://api.github.com/users/pebble-examples/events{/privacy}","received_events_url":"https://api.github.com/users/pebble-examples/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pebble-examples/pebble-faces","description":"A simple app that shows how to fetch PBI images from the internet and display them on Pebble (with PebbleKit JavaScript)","fork":false,"url":"https://api.github.com/repos/pebble-examples/pebble-faces","forks_url":"https://api.github.com/repos/pebble-examples/pebble-faces/forks","keys_url":"https://api.github.com/repos/pebble-examples/pebble-faces/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pebble-examples/pebble-faces/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pebble-examples/pebble-faces/teams","hooks_url":"https://api.github.com/repos/pebble-examples/pebble-faces/hooks","issue_events_url":"https://api.github.com/repos/pebble-examples/pebble-faces/issues/events{/number}","events_url":"https://api.github.com/repos/pebble-examples/pebble-faces/events","assignees_url":"https://api.github.com/repos/pebble-examples/pebble-faces/assignees{/user}","branches_url":"https://api.github.com/repos/pebble-examples/pebble-faces/branches{/branch}","tags_url":"https://api.github.com/repos/pebble-examples/pebble-faces/tags","blobs_url":"https://api.github.com/repos/pebble-examples/pebble-faces/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pebble-examples/pebble-faces/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pebble-examples/pebble-faces/git/refs{/sha}","trees_url":"https://api.github.com/repos/pebble-examples/pebble-faces/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pebble-examples/pebble-faces/statuses/{sha}","languages_url":"https://api.github.com/repos/pebble-examples/pebble-faces/languages","stargazers_url":"https://api.github.com/repos/pebble-examples/pebble-faces/stargazers","contributors_url":"https://api.github.com/repos/pebble-examples/pebble-faces/contributors","subscribers_url":"https://api.github.com/repos/pebble-examples/pebble-faces/subscribers","subscription_url":"https://api.github.com/repos/pebble-examples/pebble-faces/subscription","commits_url":"https://api.github.com/repos/pebble-examples/pebble-faces/commits{/sha}","git_commits_url":"https://api.github.com/repos/pebble-examples/pebble-faces/git/commits{/sha}","comments_url":"https://api.github.com/repos/pebble-examples/pebble-faces/comments{/number}","issue_comment_url":"https://api.github.com/repos/pebble-examples/pebble-faces/issues/comments{/number}","contents_url":"https://api.github.com/repos/pebble-examples/pebble-faces/contents/{+path}","compare_url":"https://api.github.com/repos/pebble-examples/pebble-faces/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pebble-examples/pebble-faces/merges","archive_url":"https://api.github.com/repos/pebble-examples/pebble-faces/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pebble-examples/pebble-faces/downloads","issues_url":"https://api.github.com/repos/pebble-examples/pebble-faces/issues{/number}","pulls_url":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls{/number}","milestones_url":"https://api.github.com/repos/pebble-examples/pebble-faces/milestones{/number}","notifications_url":"https://api.github.com/repos/pebble-examples/pebble-faces/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pebble-examples/pebble-faces/labels{/name}","releases_url":"https://api.github.com/repos/pebble-examples/pebble-faces/releases{/id}","created_at":"2013-11-22T19:57:08Z","updated_at":"2015-05-05T05:40:52Z","pushed_at":"2015-05-12T23:50:01Z","git_url":"git://github.com/pebble-examples/pebble-faces.git","ssh_url":"git@github.com:pebble-examples/pebble-faces.git","clone_url":"https://github.com/pebble-examples/pebble-faces.git","svn_url":"https://github.com/pebble-examples/pebble-faces","homepage":null,"size":347,"stargazers_count":25,"watchers_count":25,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":7,"forks":16,"open_issues":7,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15"},"html":{"href":"https://github.com/pebble-examples/pebble-faces/pull/15"},"issue":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/issues/15"},"comments":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/pebble-examples/pebble-faces/statuses/3ead5b84dc4b9ae529c7234af25bfc425fa6f955"}}}}