{"action":"created","comment":{"url":"https://api.github.com/repos/futuware/html2png/pulls/comments/38325094","id":38325094,"diff_hunk":"@@ -18,14 +19,23 @@ class ScreenShotService(object):\n \n     def get_maybe_cached_html_as_base_64_image(self, html):\n         driver = self.get_driver()\n-        cache_key = str(openssl_sha1(html))\n-        if cache_key not in self._cache:\n-            html = re.sub(r'\"', '\\\\\"', html)\n-            driver.execute_script('document.documentElement.innerHTML = \"%s\"' % html)\n-            base64 = driver.get_screenshot_as_base64()\n-            self._cache[cache_key] = base64\n-            return base64\n-        return self._cache[cache_key]\n+        \n+        html = re.sub(r'\"', '\\\\\"', html)\n+        html = re.sub(r'\\n', '', html)\n+        driver.execute_script('document.body.innerHTML = \"%s\"' % html) #documentElement.innerHTML\n+\n+        time.sleep(1) #ждать одну секунду догрузки","path":"screenshot_service.py","position":24,"original_position":24,"commit_id":"2c34fb816603052fbedd67e971338222ee6ebfb9","original_commit_id":"2c34fb816603052fbedd67e971338222ee6ebfb9","user":{"login":"muliwe","id":12555193,"avatar_url":"https://avatars.githubusercontent.com/u/12555193?v=3","gravatar_id":"","url":"https://api.github.com/users/muliwe","html_url":"https://github.com/muliwe","followers_url":"https://api.github.com/users/muliwe/followers","following_url":"https://api.github.com/users/muliwe/following{/other_user}","gists_url":"https://api.github.com/users/muliwe/gists{/gist_id}","starred_url":"https://api.github.com/users/muliwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muliwe/subscriptions","organizations_url":"https://api.github.com/users/muliwe/orgs","repos_url":"https://api.github.com/users/muliwe/repos","events_url":"https://api.github.com/users/muliwe/events{/privacy}","received_events_url":"https://api.github.com/users/muliwe/received_events","type":"User","site_admin":false},"body":"пропустил. окей.\n\n2015-08-31 18:33 GMT+03:00 Andrey Zhukovskiy <notifications@github.com>:\n\n> In screenshot_service.py\n> <https://github.com/futuware/html2png/pull/1#discussion_r38324012>:\n>\n> > @@ -18,14 +19,23 @@ class ScreenShotService(object):\n> >\n> >      def get_maybe_cached_html_as_base_64_image(self, html):\n> >          driver = self.get_driver()\n> > -        cache_key = str(openssl_sha1(html))\n> > -        if cache_key not in self._cache:\n> > -            html = re.sub(r'\"', '\\\\\"', html)\n> > -            driver.execute_script('document.documentElement.innerHTML = \"%s\"' % html)\n> > -            base64 = driver.get_screenshot_as_base64()\n> > -            self._cache[cache_key] = base64\n> > -            return base64\n> > -        return self._cache[cache_key]\n> > +\n> > +        html = re.sub(r'\"', '\\\\\"', html)\n> > +        html = re.sub(r'\\n', '', html)\n> > +        driver.execute_script('document.body.innerHTML = \"%s\"' % html) #documentElement.innerHTML\n> > +\n> > +        time.sleep(1) #ждать одну секунду догрузки\n>\n> Я ж там выше написал, фонты инлайним полюбой\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/futuware/html2png/pull/1/files#r38324012>.\n>\n","created_at":"2015-08-31T15:43:15Z","updated_at":"2015-08-31T15:43:15Z","html_url":"https://github.com/futuware/html2png/pull/1#discussion_r38325094","pull_request_url":"https://api.github.com/repos/futuware/html2png/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/futuware/html2png/pulls/comments/38325094"},"html":{"href":"https://github.com/futuware/html2png/pull/1#discussion_r38325094"},"pull_request":{"href":"https://api.github.com/repos/futuware/html2png/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/futuware/html2png/pulls/1","id":43767169,"html_url":"https://github.com/futuware/html2png/pull/1","diff_url":"https://github.com/futuware/html2png/pull/1.diff","patch_url":"https://github.com/futuware/html2png/pull/1.patch","issue_url":"https://api.github.com/repos/futuware/html2png/issues/1","number":1,"state":"open","locked":false,"title":"[WIP] Feature add external page source","user":{"login":"muliwe","id":12555193,"avatar_url":"https://avatars.githubusercontent.com/u/12555193?v=3","gravatar_id":"","url":"https://api.github.com/users/muliwe","html_url":"https://github.com/muliwe","followers_url":"https://api.github.com/users/muliwe/followers","following_url":"https://api.github.com/users/muliwe/following{/other_user}","gists_url":"https://api.github.com/users/muliwe/gists{/gist_id}","starred_url":"https://api.github.com/users/muliwe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muliwe/subscriptions","organizations_url":"https://api.github.com/users/muliwe/orgs","repos_url":"https://api.github.com/users/muliwe/repos","events_url":"https://api.github.com/users/muliwe/events{/privacy}","received_events_url":"https://api.github.com/users/muliwe/received_events","type":"User","site_admin":false},"body":"Генерация картинок из html: http://slavery.futuware.ru/browse/DIRT-2762","created_at":"2015-08-31T14:01:28Z","updated_at":"2015-08-31T15:43:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"251feaa5f8014896fe5a58f723bdac067867a4f3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/futuware/html2png/pulls/1/commits","review_comments_url":"https://api.github.com/repos/futuware/html2png/pulls/1/comments","review_comment_url":"https://api.github.com/repos/futuware/html2png/pulls/comments{/number}","comments_url":"https://api.github.com/repos/futuware/html2png/issues/1/comments","statuses_url":"https://api.github.com/repos/futuware/html2png/statuses/2c34fb816603052fbedd67e971338222ee6ebfb9","head":{"label":"futuware:feature-add-external-page-source","ref":"feature-add-external-page-source","sha":"2c34fb816603052fbedd67e971338222ee6ebfb9","user":{"login":"futuware","id":2385354,"avatar_url":"https://avatars.githubusercontent.com/u/2385354?v=3","gravatar_id":"","url":"https://api.github.com/users/futuware","html_url":"https://github.com/futuware","followers_url":"https://api.github.com/users/futuware/followers","following_url":"https://api.github.com/users/futuware/following{/other_user}","gists_url":"https://api.github.com/users/futuware/gists{/gist_id}","starred_url":"https://api.github.com/users/futuware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuware/subscriptions","organizations_url":"https://api.github.com/users/futuware/orgs","repos_url":"https://api.github.com/users/futuware/repos","events_url":"https://api.github.com/users/futuware/events{/privacy}","received_events_url":"https://api.github.com/users/futuware/received_events","type":"Organization","site_admin":false},"repo":{"id":40990782,"name":"html2png","full_name":"futuware/html2png","owner":{"login":"futuware","id":2385354,"avatar_url":"https://avatars.githubusercontent.com/u/2385354?v=3","gravatar_id":"","url":"https://api.github.com/users/futuware","html_url":"https://github.com/futuware","followers_url":"https://api.github.com/users/futuware/followers","following_url":"https://api.github.com/users/futuware/following{/other_user}","gists_url":"https://api.github.com/users/futuware/gists{/gist_id}","starred_url":"https://api.github.com/users/futuware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuware/subscriptions","organizations_url":"https://api.github.com/users/futuware/orgs","repos_url":"https://api.github.com/users/futuware/repos","events_url":"https://api.github.com/users/futuware/events{/privacy}","received_events_url":"https://api.github.com/users/futuware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/futuware/html2png","description":"[WIP] Chromedriver-based dockerized service which accepts html and responds with base64-encoded png screenshot of that html","fork":false,"url":"https://api.github.com/repos/futuware/html2png","forks_url":"https://api.github.com/repos/futuware/html2png/forks","keys_url":"https://api.github.com/repos/futuware/html2png/keys{/key_id}","collaborators_url":"https://api.github.com/repos/futuware/html2png/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/futuware/html2png/teams","hooks_url":"https://api.github.com/repos/futuware/html2png/hooks","issue_events_url":"https://api.github.com/repos/futuware/html2png/issues/events{/number}","events_url":"https://api.github.com/repos/futuware/html2png/events","assignees_url":"https://api.github.com/repos/futuware/html2png/assignees{/user}","branches_url":"https://api.github.com/repos/futuware/html2png/branches{/branch}","tags_url":"https://api.github.com/repos/futuware/html2png/tags","blobs_url":"https://api.github.com/repos/futuware/html2png/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/futuware/html2png/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/futuware/html2png/git/refs{/sha}","trees_url":"https://api.github.com/repos/futuware/html2png/git/trees{/sha}","statuses_url":"https://api.github.com/repos/futuware/html2png/statuses/{sha}","languages_url":"https://api.github.com/repos/futuware/html2png/languages","stargazers_url":"https://api.github.com/repos/futuware/html2png/stargazers","contributors_url":"https://api.github.com/repos/futuware/html2png/contributors","subscribers_url":"https://api.github.com/repos/futuware/html2png/subscribers","subscription_url":"https://api.github.com/repos/futuware/html2png/subscription","commits_url":"https://api.github.com/repos/futuware/html2png/commits{/sha}","git_commits_url":"https://api.github.com/repos/futuware/html2png/git/commits{/sha}","comments_url":"https://api.github.com/repos/futuware/html2png/comments{/number}","issue_comment_url":"https://api.github.com/repos/futuware/html2png/issues/comments{/number}","contents_url":"https://api.github.com/repos/futuware/html2png/contents/{+path}","compare_url":"https://api.github.com/repos/futuware/html2png/compare/{base}...{head}","merges_url":"https://api.github.com/repos/futuware/html2png/merges","archive_url":"https://api.github.com/repos/futuware/html2png/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/futuware/html2png/downloads","issues_url":"https://api.github.com/repos/futuware/html2png/issues{/number}","pulls_url":"https://api.github.com/repos/futuware/html2png/pulls{/number}","milestones_url":"https://api.github.com/repos/futuware/html2png/milestones{/number}","notifications_url":"https://api.github.com/repos/futuware/html2png/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/futuware/html2png/labels{/name}","releases_url":"https://api.github.com/repos/futuware/html2png/releases{/id}","created_at":"2015-08-18T18:38:50Z","updated_at":"2015-08-18T18:40:16Z","pushed_at":"2015-08-31T14:01:28Z","git_url":"git://github.com/futuware/html2png.git","ssh_url":"git@github.com:futuware/html2png.git","clone_url":"https://github.com/futuware/html2png.git","svn_url":"https://github.com/futuware/html2png","homepage":"","size":120,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"futuware:master","ref":"master","sha":"cd5aec5abce263ec58d785c50611dd0c8a6e36e6","user":{"login":"futuware","id":2385354,"avatar_url":"https://avatars.githubusercontent.com/u/2385354?v=3","gravatar_id":"","url":"https://api.github.com/users/futuware","html_url":"https://github.com/futuware","followers_url":"https://api.github.com/users/futuware/followers","following_url":"https://api.github.com/users/futuware/following{/other_user}","gists_url":"https://api.github.com/users/futuware/gists{/gist_id}","starred_url":"https://api.github.com/users/futuware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuware/subscriptions","organizations_url":"https://api.github.com/users/futuware/orgs","repos_url":"https://api.github.com/users/futuware/repos","events_url":"https://api.github.com/users/futuware/events{/privacy}","received_events_url":"https://api.github.com/users/futuware/received_events","type":"Organization","site_admin":false},"repo":{"id":40990782,"name":"html2png","full_name":"futuware/html2png","owner":{"login":"futuware","id":2385354,"avatar_url":"https://avatars.githubusercontent.com/u/2385354?v=3","gravatar_id":"","url":"https://api.github.com/users/futuware","html_url":"https://github.com/futuware","followers_url":"https://api.github.com/users/futuware/followers","following_url":"https://api.github.com/users/futuware/following{/other_user}","gists_url":"https://api.github.com/users/futuware/gists{/gist_id}","starred_url":"https://api.github.com/users/futuware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/futuware/subscriptions","organizations_url":"https://api.github.com/users/futuware/orgs","repos_url":"https://api.github.com/users/futuware/repos","events_url":"https://api.github.com/users/futuware/events{/privacy}","received_events_url":"https://api.github.com/users/futuware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/futuware/html2png","description":"[WIP] Chromedriver-based dockerized service which accepts html and responds with base64-encoded png screenshot of that html","fork":false,"url":"https://api.github.com/repos/futuware/html2png","forks_url":"https://api.github.com/repos/futuware/html2png/forks","keys_url":"https://api.github.com/repos/futuware/html2png/keys{/key_id}","collaborators_url":"https://api.github.com/repos/futuware/html2png/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/futuware/html2png/teams","hooks_url":"https://api.github.com/repos/futuware/html2png/hooks","issue_events_url":"https://api.github.com/repos/futuware/html2png/issues/events{/number}","events_url":"https://api.github.com/repos/futuware/html2png/events","assignees_url":"https://api.github.com/repos/futuware/html2png/assignees{/user}","branches_url":"https://api.github.com/repos/futuware/html2png/branches{/branch}","tags_url":"https://api.github.com/repos/futuware/html2png/tags","blobs_url":"https://api.github.com/repos/futuware/html2png/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/futuware/html2png/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/futuware/html2png/git/refs{/sha}","trees_url":"https://api.github.com/repos/futuware/html2png/git/trees{/sha}","statuses_url":"https://api.github.com/repos/futuware/html2png/statuses/{sha}","languages_url":"https://api.github.com/repos/futuware/html2png/languages","stargazers_url":"https://api.github.com/repos/futuware/html2png/stargazers","contributors_url":"https://api.github.com/repos/futuware/html2png/contributors","subscribers_url":"https://api.github.com/repos/futuware/html2png/subscribers","subscription_url":"https://api.github.com/repos/futuware/html2png/subscription","commits_url":"https://api.github.com/repos/futuware/html2png/commits{/sha}","git_commits_url":"https://api.github.com/repos/futuware/html2png/git/commits{/sha}","comments_url":"https://api.github.com/repos/futuware/html2png/comments{/number}","issue_comment_url":"https://api.github.com/repos/futuware/html2png/issues/comments{/number}","contents_url":"https://api.github.com/repos/futuware/html2png/contents/{+path}","compare_url":"https://api.github.com/repos/futuware/html2png/compare/{base}...{head}","merges_url":"https://api.github.com/repos/futuware/html2png/merges","archive_url":"https://api.github.com/repos/futuware/html2png/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/futuware/html2png/downloads","issues_url":"https://api.github.com/repos/futuware/html2png/issues{/number}","pulls_url":"https://api.github.com/repos/futuware/html2png/pulls{/number}","milestones_url":"https://api.github.com/repos/futuware/html2png/milestones{/number}","notifications_url":"https://api.github.com/repos/futuware/html2png/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/futuware/html2png/labels{/name}","releases_url":"https://api.github.com/repos/futuware/html2png/releases{/id}","created_at":"2015-08-18T18:38:50Z","updated_at":"2015-08-18T18:40:16Z","pushed_at":"2015-08-31T14:01:28Z","git_url":"git://github.com/futuware/html2png.git","ssh_url":"git@github.com:futuware/html2png.git","clone_url":"https://github.com/futuware/html2png.git","svn_url":"https://github.com/futuware/html2png","homepage":"","size":120,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/futuware/html2png/pulls/1"},"html":{"href":"https://github.com/futuware/html2png/pull/1"},"issue":{"href":"https://api.github.com/repos/futuware/html2png/issues/1"},"comments":{"href":"https://api.github.com/repos/futuware/html2png/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/futuware/html2png/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/futuware/html2png/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/futuware/html2png/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/futuware/html2png/statuses/2c34fb816603052fbedd67e971338222ee6ebfb9"}}}}