{"action":"created","comment":{"url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/comments/32524960","id":32524960,"diff_hunk":"@@ -216,19 +217,27 @@ def get_fallback(self, url):\n \n     def load_oembed(self, action):\n         url = self.widgets['url'].value\n-        if url != '':\n-            consumer = component.getUtility(IConsumer)\n-            json_data = consumer.get_data(url, maxwidth=None, maxheight=None,\n-                                          format='json')\n+        if url == '':\n+            return\n+\n+        v = validation.validatorFor('isURL')\n+        if v(url) != 1:\n+            plone_utils = api.portal.get_tool(name='plone_utils')\n+            plone_utils.addPortalMessage(_(u'URL invalid'), 'info')","path":"src/sc/embedder/content/embedder.py","position":22,"original_position":22,"commit_id":"f88b4fc19148d7ae8eee3adf53f4e38dd500e1a8","original_commit_id":"f88b4fc19148d7ae8eee3adf53f4e38dd500e1a8","user":{"login":"hvelarde","id":341393,"avatar_url":"https://avatars.githubusercontent.com/u/341393?v=3","gravatar_id":"","url":"https://api.github.com/users/hvelarde","html_url":"https://github.com/hvelarde","followers_url":"https://api.github.com/users/hvelarde/followers","following_url":"https://api.github.com/users/hvelarde/following{/other_user}","gists_url":"https://api.github.com/users/hvelarde/gists{/gist_id}","starred_url":"https://api.github.com/users/hvelarde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvelarde/subscriptions","organizations_url":"https://api.github.com/users/hvelarde/orgs","repos_url":"https://api.github.com/users/hvelarde/repos","events_url":"https://api.github.com/users/hvelarde/events{/privacy}","received_events_url":"https://api.github.com/users/hvelarde/received_events","type":"User","site_admin":false},"body":"you can use just ``api.portal.show_message()``\r\n\r\nsee: http://docs.plone.org/external/plone.api/docs/portal.html#portal-show-message-example","created_at":"2015-06-16T14:18:48Z","updated_at":"2015-06-16T14:18:48Z","html_url":"https://github.com/simplesconsultoria/sc.embedder/pull/25#discussion_r32524960","pull_request_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/comments/32524960"},"html":{"href":"https://github.com/simplesconsultoria/sc.embedder/pull/25#discussion_r32524960"},"pull_request":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25","id":37790599,"html_url":"https://github.com/simplesconsultoria/sc.embedder/pull/25","diff_url":"https://github.com/simplesconsultoria/sc.embedder/pull/25.diff","patch_url":"https://github.com/simplesconsultoria/sc.embedder/pull/25.patch","issue_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/25","number":25,"state":"open","locked":false,"title":"Add validation in url field","user":{"login":"rodfersou","id":131209,"avatar_url":"https://avatars.githubusercontent.com/u/131209?v=3","gravatar_id":"","url":"https://api.github.com/users/rodfersou","html_url":"https://github.com/rodfersou","followers_url":"https://api.github.com/users/rodfersou/followers","following_url":"https://api.github.com/users/rodfersou/following{/other_user}","gists_url":"https://api.github.com/users/rodfersou/gists{/gist_id}","starred_url":"https://api.github.com/users/rodfersou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodfersou/subscriptions","organizations_url":"https://api.github.com/users/rodfersou/orgs","repos_url":"https://api.github.com/users/rodfersou/repos","events_url":"https://api.github.com/users/rodfersou/events{/privacy}","received_events_url":"https://api.github.com/users/rodfersou/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-16T12:45:21Z","updated_at":"2015-06-16T14:18:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7057bf91175ae186e5d894c6a0c962ba512c3a3b","assignee":{"login":"hvelarde","id":341393,"avatar_url":"https://avatars.githubusercontent.com/u/341393?v=3","gravatar_id":"","url":"https://api.github.com/users/hvelarde","html_url":"https://github.com/hvelarde","followers_url":"https://api.github.com/users/hvelarde/followers","following_url":"https://api.github.com/users/hvelarde/following{/other_user}","gists_url":"https://api.github.com/users/hvelarde/gists{/gist_id}","starred_url":"https://api.github.com/users/hvelarde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvelarde/subscriptions","organizations_url":"https://api.github.com/users/hvelarde/orgs","repos_url":"https://api.github.com/users/hvelarde/repos","events_url":"https://api.github.com/users/hvelarde/events{/privacy}","received_events_url":"https://api.github.com/users/hvelarde/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25/commits","review_comments_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25/comments","review_comment_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/25/comments","statuses_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/statuses/f88b4fc19148d7ae8eee3adf53f4e38dd500e1a8","head":{"label":"simplesconsultoria:issue_20","ref":"issue_20","sha":"f88b4fc19148d7ae8eee3adf53f4e38dd500e1a8","user":{"login":"simplesconsultoria","id":869279,"avatar_url":"https://avatars.githubusercontent.com/u/869279?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesconsultoria","html_url":"https://github.com/simplesconsultoria","followers_url":"https://api.github.com/users/simplesconsultoria/followers","following_url":"https://api.github.com/users/simplesconsultoria/following{/other_user}","gists_url":"https://api.github.com/users/simplesconsultoria/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesconsultoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesconsultoria/subscriptions","organizations_url":"https://api.github.com/users/simplesconsultoria/orgs","repos_url":"https://api.github.com/users/simplesconsultoria/repos","events_url":"https://api.github.com/users/simplesconsultoria/events{/privacy}","received_events_url":"https://api.github.com/users/simplesconsultoria/received_events","type":"Organization","site_admin":false},"repo":{"id":5289397,"name":"sc.embedder","full_name":"simplesconsultoria/sc.embedder","owner":{"login":"simplesconsultoria","id":869279,"avatar_url":"https://avatars.githubusercontent.com/u/869279?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesconsultoria","html_url":"https://github.com/simplesconsultoria","followers_url":"https://api.github.com/users/simplesconsultoria/followers","following_url":"https://api.github.com/users/simplesconsultoria/following{/other_user}","gists_url":"https://api.github.com/users/simplesconsultoria/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesconsultoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesconsultoria/subscriptions","organizations_url":"https://api.github.com/users/simplesconsultoria/orgs","repos_url":"https://api.github.com/users/simplesconsultoria/repos","events_url":"https://api.github.com/users/simplesconsultoria/events{/privacy}","received_events_url":"https://api.github.com/users/simplesconsultoria/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplesconsultoria/sc.embedder","description":"A content type to embed multimedia content in Plone.","fork":false,"url":"https://api.github.com/repos/simplesconsultoria/sc.embedder","forks_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/forks","keys_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/teams","hooks_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/hooks","issue_events_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/events{/number}","events_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/events","assignees_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/assignees{/user}","branches_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/branches{/branch}","tags_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/tags","blobs_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/statuses/{sha}","languages_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/languages","stargazers_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/stargazers","contributors_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/contributors","subscribers_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/subscribers","subscription_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/subscription","commits_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/contents/{+path}","compare_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/merges","archive_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/downloads","issues_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues{/number}","pulls_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls{/number}","milestones_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/milestones{/number}","notifications_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/labels{/name}","releases_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/releases{/id}","created_at":"2012-08-03T19:20:38Z","updated_at":"2015-04-22T04:32:06Z","pushed_at":"2015-06-16T12:47:15Z","git_url":"git://github.com/simplesconsultoria/sc.embedder.git","ssh_url":"git@github.com:simplesconsultoria/sc.embedder.git","clone_url":"https://github.com/simplesconsultoria/sc.embedder.git","svn_url":"https://github.com/simplesconsultoria/sc.embedder","homepage":null,"size":694,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":10,"forks":1,"open_issues":10,"watchers":1,"default_branch":"master"}},"base":{"label":"simplesconsultoria:master","ref":"master","sha":"0c3f0908a027b1acfd96de086bc3e35e9071448b","user":{"login":"simplesconsultoria","id":869279,"avatar_url":"https://avatars.githubusercontent.com/u/869279?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesconsultoria","html_url":"https://github.com/simplesconsultoria","followers_url":"https://api.github.com/users/simplesconsultoria/followers","following_url":"https://api.github.com/users/simplesconsultoria/following{/other_user}","gists_url":"https://api.github.com/users/simplesconsultoria/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesconsultoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesconsultoria/subscriptions","organizations_url":"https://api.github.com/users/simplesconsultoria/orgs","repos_url":"https://api.github.com/users/simplesconsultoria/repos","events_url":"https://api.github.com/users/simplesconsultoria/events{/privacy}","received_events_url":"https://api.github.com/users/simplesconsultoria/received_events","type":"Organization","site_admin":false},"repo":{"id":5289397,"name":"sc.embedder","full_name":"simplesconsultoria/sc.embedder","owner":{"login":"simplesconsultoria","id":869279,"avatar_url":"https://avatars.githubusercontent.com/u/869279?v=3","gravatar_id":"","url":"https://api.github.com/users/simplesconsultoria","html_url":"https://github.com/simplesconsultoria","followers_url":"https://api.github.com/users/simplesconsultoria/followers","following_url":"https://api.github.com/users/simplesconsultoria/following{/other_user}","gists_url":"https://api.github.com/users/simplesconsultoria/gists{/gist_id}","starred_url":"https://api.github.com/users/simplesconsultoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplesconsultoria/subscriptions","organizations_url":"https://api.github.com/users/simplesconsultoria/orgs","repos_url":"https://api.github.com/users/simplesconsultoria/repos","events_url":"https://api.github.com/users/simplesconsultoria/events{/privacy}","received_events_url":"https://api.github.com/users/simplesconsultoria/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplesconsultoria/sc.embedder","description":"A content type to embed multimedia content in Plone.","fork":false,"url":"https://api.github.com/repos/simplesconsultoria/sc.embedder","forks_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/forks","keys_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/teams","hooks_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/hooks","issue_events_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/events{/number}","events_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/events","assignees_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/assignees{/user}","branches_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/branches{/branch}","tags_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/tags","blobs_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/statuses/{sha}","languages_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/languages","stargazers_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/stargazers","contributors_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/contributors","subscribers_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/subscribers","subscription_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/subscription","commits_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/comments{/number}","contents_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/contents/{+path}","compare_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/merges","archive_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/downloads","issues_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues{/number}","pulls_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls{/number}","milestones_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/milestones{/number}","notifications_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/labels{/name}","releases_url":"https://api.github.com/repos/simplesconsultoria/sc.embedder/releases{/id}","created_at":"2012-08-03T19:20:38Z","updated_at":"2015-04-22T04:32:06Z","pushed_at":"2015-06-16T12:47:15Z","git_url":"git://github.com/simplesconsultoria/sc.embedder.git","ssh_url":"git@github.com:simplesconsultoria/sc.embedder.git","clone_url":"https://github.com/simplesconsultoria/sc.embedder.git","svn_url":"https://github.com/simplesconsultoria/sc.embedder","homepage":null,"size":694,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":10,"forks":1,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25"},"html":{"href":"https://github.com/simplesconsultoria/sc.embedder/pull/25"},"issue":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/25"},"comments":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/simplesconsultoria/sc.embedder/statuses/f88b4fc19148d7ae8eee3adf53f4e38dd500e1a8"}}}}