{"action":"created","issue":{"url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/issues/114","repository_url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp","labels_url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/issues/114/comments","events_url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/issues/114/events","html_url":"https://github.com/AdguardTeam/ReportsWebApp/issues/114","id":281161357,"number":114,"title":"Change the way we validate image URLs","user":{"login":"ameshkov","id":5947035,"avatar_url":"https://avatars0.githubusercontent.com/u/5947035?v=4","gravatar_id":"","url":"https://api.github.com/users/ameshkov","html_url":"https://github.com/ameshkov","followers_url":"https://api.github.com/users/ameshkov/followers","following_url":"https://api.github.com/users/ameshkov/following{/other_user}","gists_url":"https://api.github.com/users/ameshkov/gists{/gist_id}","starred_url":"https://api.github.com/users/ameshkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ameshkov/subscriptions","organizations_url":"https://api.github.com/users/ameshkov/orgs","repos_url":"https://api.github.com/users/ameshkov/repos","events_url":"https://api.github.com/users/ameshkov/events{/privacy}","received_events_url":"https://api.github.com/users/ameshkov/received_events","type":"User","site_admin":false},"labels":[{"id":536057492,"url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":738764903,"url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/labels/P2:%20High","name":"P2: High","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"seanl-adg","id":22858651,"avatar_url":"https://avatars1.githubusercontent.com/u/22858651?v=4","gravatar_id":"","url":"https://api.github.com/users/seanl-adg","html_url":"https://github.com/seanl-adg","followers_url":"https://api.github.com/users/seanl-adg/followers","following_url":"https://api.github.com/users/seanl-adg/following{/other_user}","gists_url":"https://api.github.com/users/seanl-adg/gists{/gist_id}","starred_url":"https://api.github.com/users/seanl-adg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanl-adg/subscriptions","organizations_url":"https://api.github.com/users/seanl-adg/orgs","repos_url":"https://api.github.com/users/seanl-adg/repos","events_url":"https://api.github.com/users/seanl-adg/events{/privacy}","received_events_url":"https://api.github.com/users/seanl-adg/received_events","type":"User","site_admin":false},"assignees":[{"login":"seanl-adg","id":22858651,"avatar_url":"https://avatars1.githubusercontent.com/u/22858651?v=4","gravatar_id":"","url":"https://api.github.com/users/seanl-adg","html_url":"https://github.com/seanl-adg","followers_url":"https://api.github.com/users/seanl-adg/followers","following_url":"https://api.github.com/users/seanl-adg/following{/other_user}","gists_url":"https://api.github.com/users/seanl-adg/gists{/gist_id}","starred_url":"https://api.github.com/users/seanl-adg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanl-adg/subscriptions","organizations_url":"https://api.github.com/users/seanl-adg/orgs","repos_url":"https://api.github.com/users/seanl-adg/repos","events_url":"https://api.github.com/users/seanl-adg/events{/privacy}","received_events_url":"https://api.github.com/users/seanl-adg/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/milestones/2","html_url":"https://github.com/AdguardTeam/ReportsWebApp/milestone/2","labels_url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/milestones/2/labels","id":2688732,"number":2,"title":"2.0","description":"Improved versions capable of receiving files","creator":{"login":"ameshkov","id":5947035,"avatar_url":"https://avatars0.githubusercontent.com/u/5947035?v=4","gravatar_id":"","url":"https://api.github.com/users/ameshkov","html_url":"https://github.com/ameshkov","followers_url":"https://api.github.com/users/ameshkov/followers","following_url":"https://api.github.com/users/ameshkov/following{/other_user}","gists_url":"https://api.github.com/users/ameshkov/gists{/gist_id}","starred_url":"https://api.github.com/users/ameshkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ameshkov/subscriptions","organizations_url":"https://api.github.com/users/ameshkov/orgs","repos_url":"https://api.github.com/users/ameshkov/repos","events_url":"https://api.github.com/users/ameshkov/events{/privacy}","received_events_url":"https://api.github.com/users/ameshkov/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":17,"state":"open","created_at":"2017-08-08T17:15:19Z","updated_at":"2017-12-18T12:24:21Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2017-12-11T20:46:13Z","updated_at":"2017-12-25T18:51:41Z","closed_at":null,"author_association":"OWNER","body":"Currently, you add an `img` element and check if it is loaded successfully. This is okay as a temporary solution, but it's time to improve it.\r\n\r\nInstead of adding `img`, we should now send an XHR request to `window.image_upload_url` with method POST and a single parameter `url`.\r\n\r\nThis web service does some awesome things:\r\n1. Validates the image\r\n2. Handles gdrive/dropbox links\r\n3. Uploads the image to imgur\r\n\r\n**Carefully, pseudo-code below:**\r\n```\r\naddImagePreview(imageUrl); // Just to let user know that image validation is in progress\r\n$.post(window.image_upload_url, {\r\n    url: imageUrl\r\n}).then(function(response) {\r\n    if (response.url) {\r\n        // Response is valid, use `response.url` from now on\r\n        replaceImagePreview(response.url);\r\n    } else {\r\n        // Image is not valid, do something\r\n    }\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/issues/comments/353884908","html_url":"https://github.com/AdguardTeam/ReportsWebApp/issues/114#issuecomment-353884908","issue_url":"https://api.github.com/repos/AdguardTeam/ReportsWebApp/issues/114","id":353884908,"user":{"login":"sc0rp10","id":597762,"avatar_url":"https://avatars2.githubusercontent.com/u/597762?v=4","gravatar_id":"","url":"https://api.github.com/users/sc0rp10","html_url":"https://github.com/sc0rp10","followers_url":"https://api.github.com/users/sc0rp10/followers","following_url":"https://api.github.com/users/sc0rp10/following{/other_user}","gists_url":"https://api.github.com/users/sc0rp10/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0rp10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0rp10/subscriptions","organizations_url":"https://api.github.com/users/sc0rp10/orgs","repos_url":"https://api.github.com/users/sc0rp10/repos","events_url":"https://api.github.com/users/sc0rp10/events{/privacy}","received_events_url":"https://api.github.com/users/sc0rp10/received_events","type":"User","site_admin":false},"created_at":"2017-12-25T18:51:41Z","updated_at":"2017-12-25T18:51:41Z","author_association":"CONTRIBUTOR","body":"@ameshkov https://reports-img.adguard.com/CjYXag9.gif"}}
{"actor":{"display_login":"sc0rp10"}}