Closed pdehaan closed 2 years ago
Was reading https://medium.com/slack-developer-blog/everything-you-ever-wanted-to-know-about-unfurling-but-were-afraid-to-ask-or-how-to-make-your-e64b4bb9254#.cchchs8s3 and started looking into http://oembed.com/.
Not sure if it's worth it to try and search for oembed service stuff in a webpage instead of trying to scrape a page's DOM and extract tags.
Here's 3 results from random tabs that I happened to have open:
https://www.youtube.com/watch?v=qjwujvv1E0w&feature=youtu.be:
<link rel="alternate" type="application/json+oembed" href="http://www.youtube.com/oembedurl=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dqjwujvv1E0w&format=json" title="Urban Agriculture in Focus: Greenhouse vs. Indoor Growing">
Output:
{ "author_name": "Bright Agrotech", "author_url": "https://www.youtube.com/user/BrightAgrotechLLC", "height": 270, "html": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/qjwujvv1E0w?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>", "provider_name": "YouTube", "provider_url": "https://www.youtube.com/", "thumbnail_height": 360, "thumbnail_url": "https://i.ytimg.com/vi/qjwujvv1E0w/hqdefault.jpg", "thumbnail_width": 480, "title": "Urban Agriculture in Focus: Greenhouse vs. Indoor Growing", "type": "video", "version": "1.0", "width": 480 }
http://www.greenkitchenstories.com/the-green-kitchen-smoothies-book/:
<link rel="alternate" type="application/json+oembed" href="http://www.greenkitchenstories.com/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fwww.greenkitchenstories.com%2Fthe-green-kitchen-smoothies-book%2F" />
{ "author_name": "Green Kitchen Stories", "author_url": "http://www.greenkitchenstories.com/author/greenkit/", "height": 338, "html": "<iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"http://www.greenkitchenstories.com/the-green-kitchen-smoothies-book/embed/\" width=\"600\" height=\"338\" title=\"Embedded WordPress Post\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"></iframe>", "provider_name": "Green Kitchen Stories", "provider_url": "http://www.greenkitchenstories.com", "title": "Green Kitchen Smoothies", "type": "rich", "version": "1.0", "width": 600 }
https://www.flickr.com/photos/bees/2341623661/:
<link rel="alternative" type="application/json+oembed" href="https://www.flickr.com/services/oembed?url=https://www.flickr.com/photos/bees/2341623661&format=json" />
{ "author_name": "bees", "author_url": "https://www.flickr.com/photos/bees/", "cache_age": 3600, "flickr_type": "photo", "height": "683", "html": "<a data-flickr-embed=\"true\" href=\"https://www.flickr.com/photos/bees/2341623661/\" title=\"ZB8T0193 by bees, on Flickr\"><img src=\"https://farm4.staticflickr.com/3123/2341623661_7c99f48bbf_b.jpg\" width=\"1024\" height=\"683\" alt=\"ZB8T0193\"></a><script async src=\"https://embedr.flickr.com/assets/client-code.js\" charset=\"utf-8\"></script>", "license": "All Rights Reserved", "license_id": 0, "provider_name": "Flickr", "provider_url": "https://www.flickr.com/", "thumbnail_height": 150, "thumbnail_url": "https://farm4.staticflickr.com/3123/2341623661_7c99f48bbf_q.jpg", "thumbnail_width": 150, "title": "ZB8T0193", "type": "photo", "url": "https://farm4.staticflickr.com/3123/2341623661_7c99f48bbf_b.jpg", "version": "1.0", "web_page": "https://www.flickr.com/photos/bees/2341623661/", "web_page_short_url": "https://flic.kr/p/4yVr8K", "width": "1024" }
Was reading https://medium.com/slack-developer-blog/everything-you-ever-wanted-to-know-about-unfurling-but-were-afraid-to-ask-or-how-to-make-your-e64b4bb9254#.cchchs8s3 and started looking into http://oembed.com/.
Not sure if it's worth it to try and search for oembed service stuff in a webpage instead of trying to scrape a page's DOM and extract tags.
Here's 3 results from random tabs that I happened to have open:
https://www.youtube.com/watch?v=qjwujvv1E0w&feature=youtu.be:
Output:
http://www.greenkitchenstories.com/the-green-kitchen-smoothies-book/:
Output:
https://www.flickr.com/photos/bees/2341623661/:
Output: