{"action":"created","comment":{"url":"https://api.github.com/repos/Devex/gdocparse/pulls/comments/23329413","id":23329413,"diff_hunk":"@@ -0,0 +1,66 @@\n+require 'net/http'\n+require 'json'\n+require 'rexml/document'\n+\n+module Gdocparse\n+  module Concerns\n+    # Basic methods to handle o embed APIs\n+    module Oembed\n+      ##\n+      # get meta data for an oembed object\n+      # @return [Hash] the meta data\n+      def oembed_data\n+        @oembed_data ||= begin\n+          oembed_response_data.merge({ 'embed_url' => oembed_iframe_url} )\n+        end\n+      end\n+\n+      ##\n+      # The oembed base URL, e.g. <http://www.youtube.com/oembed>\n+      # @return [String]\n+      def oembed_base_url\n+        raise NotImplementedError,\n+          'Consuming class must implement #oembed_base_url'\n+      end\n+\n+      ##\n+      # The oembed base URL that is to be queried,\n+      # e.g. <'https://www.youtube.com/watch?v=_ZG8HBuDjgc'>\n+      # @return [String]\n+      def oembed_query_url\n+        raise NotImplementedError,\n+          'Consuming class must implement #oembed_base_url'\n+      end\n+\n+      protected\n+\n+      ##\n+      # extract the embed URL from the html snippet\n+      # @return [String]\n+      def oembed_iframe_url\n+        html = oembed_response_data['html'].sub('allowfullscreen', '')\n+        doc = REXML::Document.new(html)\n+        if doc && doc.root && doc.root.attributes['src']","path":"lib/gdocparse/concerns/oembed.rb","position":43,"original_position":43,"commit_id":"13a30334edc2d0b9c031519cab97a018b2f87b36","original_commit_id":"13a30334edc2d0b9c031519cab97a018b2f87b36","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-01-21T20:01:30Z","updated_at":"2015-01-21T20:01:30Z","html_url":"https://github.com/Devex/gdocparse/pull/5#discussion_r23329413","pull_request_url":"https://api.github.com/repos/Devex/gdocparse/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/Devex/gdocparse/pulls/comments/23329413"},"html":{"href":"https://github.com/Devex/gdocparse/pull/5#discussion_r23329413"},"pull_request":{"href":"https://api.github.com/repos/Devex/gdocparse/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Devex/gdocparse/pulls/5","id":27789878,"html_url":"https://github.com/Devex/gdocparse/pull/5","diff_url":"https://github.com/Devex/gdocparse/pull/5.diff","patch_url":"https://github.com/Devex/gdocparse/pull/5.patch","issue_url":"https://api.github.com/repos/Devex/gdocparse/issues/5","number":5,"state":"open","locked":false,"title":"added oembed concern for future embeddable elements like videos","user":{"login":"dsager","id":1056502,"avatar_url":"https://avatars.githubusercontent.com/u/1056502?v=3","gravatar_id":"","url":"https://api.github.com/users/dsager","html_url":"https://github.com/dsager","followers_url":"https://api.github.com/users/dsager/followers","following_url":"https://api.github.com/users/dsager/following{/other_user}","gists_url":"https://api.github.com/users/dsager/gists{/gist_id}","starred_url":"https://api.github.com/users/dsager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsager/subscriptions","organizations_url":"https://api.github.com/users/dsager/orgs","repos_url":"https://api.github.com/users/dsager/repos","events_url":"https://api.github.com/users/dsager/events{/privacy}","received_events_url":"https://api.github.com/users/dsager/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-21T20:01:23Z","updated_at":"2015-01-21T20:01:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbdc1a623e0a0408d0a41e25e892e0cc1e799fd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Devex/gdocparse/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Devex/gdocparse/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Devex/gdocparse/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Devex/gdocparse/issues/5/comments","statuses_url":"https://api.github.com/repos/Devex/gdocparse/statuses/13a30334edc2d0b9c031519cab97a018b2f87b36","head":{"label":"dsager:oembed-concern","ref":"oembed-concern","sha":"13a30334edc2d0b9c031519cab97a018b2f87b36","user":{"login":"dsager","id":1056502,"avatar_url":"https://avatars.githubusercontent.com/u/1056502?v=3","gravatar_id":"","url":"https://api.github.com/users/dsager","html_url":"https://github.com/dsager","followers_url":"https://api.github.com/users/dsager/followers","following_url":"https://api.github.com/users/dsager/following{/other_user}","gists_url":"https://api.github.com/users/dsager/gists{/gist_id}","starred_url":"https://api.github.com/users/dsager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsager/subscriptions","organizations_url":"https://api.github.com/users/dsager/orgs","repos_url":"https://api.github.com/users/dsager/repos","events_url":"https://api.github.com/users/dsager/events{/privacy}","received_events_url":"https://api.github.com/users/dsager/received_events","type":"User","site_admin":false},"repo":{"id":29133538,"name":"gdocparse","full_name":"dsager/gdocparse","owner":{"login":"dsager","id":1056502,"avatar_url":"https://avatars.githubusercontent.com/u/1056502?v=3","gravatar_id":"","url":"https://api.github.com/users/dsager","html_url":"https://github.com/dsager","followers_url":"https://api.github.com/users/dsager/followers","following_url":"https://api.github.com/users/dsager/following{/other_user}","gists_url":"https://api.github.com/users/dsager/gists{/gist_id}","starred_url":"https://api.github.com/users/dsager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsager/subscriptions","organizations_url":"https://api.github.com/users/dsager/orgs","repos_url":"https://api.github.com/users/dsager/repos","events_url":"https://api.github.com/users/dsager/events{/privacy}","received_events_url":"https://api.github.com/users/dsager/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dsager/gdocparse","description":"","fork":true,"url":"https://api.github.com/repos/dsager/gdocparse","forks_url":"https://api.github.com/repos/dsager/gdocparse/forks","keys_url":"https://api.github.com/repos/dsager/gdocparse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dsager/gdocparse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dsager/gdocparse/teams","hooks_url":"https://api.github.com/repos/dsager/gdocparse/hooks","issue_events_url":"https://api.github.com/repos/dsager/gdocparse/issues/events{/number}","events_url":"https://api.github.com/repos/dsager/gdocparse/events","assignees_url":"https://api.github.com/repos/dsager/gdocparse/assignees{/user}","branches_url":"https://api.github.com/repos/dsager/gdocparse/branches{/branch}","tags_url":"https://api.github.com/repos/dsager/gdocparse/tags","blobs_url":"https://api.github.com/repos/dsager/gdocparse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dsager/gdocparse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dsager/gdocparse/git/refs{/sha}","trees_url":"https://api.github.com/repos/dsager/gdocparse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dsager/gdocparse/statuses/{sha}","languages_url":"https://api.github.com/repos/dsager/gdocparse/languages","stargazers_url":"https://api.github.com/repos/dsager/gdocparse/stargazers","contributors_url":"https://api.github.com/repos/dsager/gdocparse/contributors","subscribers_url":"https://api.github.com/repos/dsager/gdocparse/subscribers","subscription_url":"https://api.github.com/repos/dsager/gdocparse/subscription","commits_url":"https://api.github.com/repos/dsager/gdocparse/commits{/sha}","git_commits_url":"https://api.github.com/repos/dsager/gdocparse/git/commits{/sha}","comments_url":"https://api.github.com/repos/dsager/gdocparse/comments{/number}","issue_comment_url":"https://api.github.com/repos/dsager/gdocparse/issues/comments/{number}","contents_url":"https://api.github.com/repos/dsager/gdocparse/contents/{+path}","compare_url":"https://api.github.com/repos/dsager/gdocparse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dsager/gdocparse/merges","archive_url":"https://api.github.com/repos/dsager/gdocparse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dsager/gdocparse/downloads","issues_url":"https://api.github.com/repos/dsager/gdocparse/issues{/number}","pulls_url":"https://api.github.com/repos/dsager/gdocparse/pulls{/number}","milestones_url":"https://api.github.com/repos/dsager/gdocparse/milestones{/number}","notifications_url":"https://api.github.com/repos/dsager/gdocparse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dsager/gdocparse/labels{/name}","releases_url":"https://api.github.com/repos/dsager/gdocparse/releases{/id}","created_at":"2015-01-12T12:02:15Z","updated_at":"2015-01-12T12:01:54Z","pushed_at":"2015-01-21T20:00:57Z","git_url":"git://github.com/dsager/gdocparse.git","ssh_url":"git@github.com:dsager/gdocparse.git","clone_url":"https://github.com/dsager/gdocparse.git","svn_url":"https://github.com/dsager/gdocparse","homepage":null,"size":116,"stargazers_count":0,"watchers_count":0,"language":null,"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":"Devex:develop","ref":"develop","sha":"0c218bc5558fa26fa1be828644f54c5303dd8fb8","user":{"login":"Devex","id":3806616,"avatar_url":"https://avatars.githubusercontent.com/u/3806616?v=3","gravatar_id":"","url":"https://api.github.com/users/Devex","html_url":"https://github.com/Devex","followers_url":"https://api.github.com/users/Devex/followers","following_url":"https://api.github.com/users/Devex/following{/other_user}","gists_url":"https://api.github.com/users/Devex/gists{/gist_id}","starred_url":"https://api.github.com/users/Devex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devex/subscriptions","organizations_url":"https://api.github.com/users/Devex/orgs","repos_url":"https://api.github.com/users/Devex/repos","events_url":"https://api.github.com/users/Devex/events{/privacy}","received_events_url":"https://api.github.com/users/Devex/received_events","type":"Organization","site_admin":false},"repo":{"id":29133526,"name":"gdocparse","full_name":"Devex/gdocparse","owner":{"login":"Devex","id":3806616,"avatar_url":"https://avatars.githubusercontent.com/u/3806616?v=3","gravatar_id":"","url":"https://api.github.com/users/Devex","html_url":"https://github.com/Devex","followers_url":"https://api.github.com/users/Devex/followers","following_url":"https://api.github.com/users/Devex/following{/other_user}","gists_url":"https://api.github.com/users/Devex/gists{/gist_id}","starred_url":"https://api.github.com/users/Devex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Devex/subscriptions","organizations_url":"https://api.github.com/users/Devex/orgs","repos_url":"https://api.github.com/users/Devex/repos","events_url":"https://api.github.com/users/Devex/events{/privacy}","received_events_url":"https://api.github.com/users/Devex/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Devex/gdocparse","description":"Library to process the content of a Google document.","fork":false,"url":"https://api.github.com/repos/Devex/gdocparse","forks_url":"https://api.github.com/repos/Devex/gdocparse/forks","keys_url":"https://api.github.com/repos/Devex/gdocparse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Devex/gdocparse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Devex/gdocparse/teams","hooks_url":"https://api.github.com/repos/Devex/gdocparse/hooks","issue_events_url":"https://api.github.com/repos/Devex/gdocparse/issues/events{/number}","events_url":"https://api.github.com/repos/Devex/gdocparse/events","assignees_url":"https://api.github.com/repos/Devex/gdocparse/assignees{/user}","branches_url":"https://api.github.com/repos/Devex/gdocparse/branches{/branch}","tags_url":"https://api.github.com/repos/Devex/gdocparse/tags","blobs_url":"https://api.github.com/repos/Devex/gdocparse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Devex/gdocparse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Devex/gdocparse/git/refs{/sha}","trees_url":"https://api.github.com/repos/Devex/gdocparse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Devex/gdocparse/statuses/{sha}","languages_url":"https://api.github.com/repos/Devex/gdocparse/languages","stargazers_url":"https://api.github.com/repos/Devex/gdocparse/stargazers","contributors_url":"https://api.github.com/repos/Devex/gdocparse/contributors","subscribers_url":"https://api.github.com/repos/Devex/gdocparse/subscribers","subscription_url":"https://api.github.com/repos/Devex/gdocparse/subscription","commits_url":"https://api.github.com/repos/Devex/gdocparse/commits{/sha}","git_commits_url":"https://api.github.com/repos/Devex/gdocparse/git/commits{/sha}","comments_url":"https://api.github.com/repos/Devex/gdocparse/comments{/number}","issue_comment_url":"https://api.github.com/repos/Devex/gdocparse/issues/comments/{number}","contents_url":"https://api.github.com/repos/Devex/gdocparse/contents/{+path}","compare_url":"https://api.github.com/repos/Devex/gdocparse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Devex/gdocparse/merges","archive_url":"https://api.github.com/repos/Devex/gdocparse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Devex/gdocparse/downloads","issues_url":"https://api.github.com/repos/Devex/gdocparse/issues{/number}","pulls_url":"https://api.github.com/repos/Devex/gdocparse/pulls{/number}","milestones_url":"https://api.github.com/repos/Devex/gdocparse/milestones{/number}","notifications_url":"https://api.github.com/repos/Devex/gdocparse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Devex/gdocparse/labels{/name}","releases_url":"https://api.github.com/repos/Devex/gdocparse/releases{/id}","created_at":"2015-01-12T12:01:54Z","updated_at":"2015-01-13T11:15:51Z","pushed_at":"2015-01-13T11:15:51Z","git_url":"git://github.com/Devex/gdocparse.git","ssh_url":"git@github.com:Devex/gdocparse.git","clone_url":"https://github.com/Devex/gdocparse.git","svn_url":"https://github.com/Devex/gdocparse","homepage":"","size":171,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Devex/gdocparse/pulls/5"},"html":{"href":"https://github.com/Devex/gdocparse/pull/5"},"issue":{"href":"https://api.github.com/repos/Devex/gdocparse/issues/5"},"comments":{"href":"https://api.github.com/repos/Devex/gdocparse/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Devex/gdocparse/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Devex/gdocparse/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Devex/gdocparse/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Devex/gdocparse/statuses/13a30334edc2d0b9c031519cab97a018b2f87b36"}}}}