How I can get Open Graph Protocol info - parsing

I want to add OG in my CRM. I found millions pages "How use Open Graph Protocol on your site" but no information about another side.
I think that loading full page and parse OG meta tags is BAD idea for creating link preview. Maybe I can load only OGP info from page?

Related

How to retrieve pages filtered by a tag from OneNote API?

Some of my pages have a OneNote Tag in it
https://learn.microsoft.com/en-us/graph/onenote-note-tags
I would like to retrieve only pages that contain a specific tag from a notebook.
Currently, I would need to
Get all the sections from a notebook
Get all the pages from a section
Get all content from pages
check if it contains data-tag="important" (example)
Is there a better way of doing this via the ms graph? (possibly via a combination of expand/filter)
Best
To get the pages in a notebook use the HTTP call below.
https://graph.microsoft.com/v1.0/me/onenote/pages
To compare the data-tag="important" is present in the content or not, it is not possible as of now but if your data is small you can use a work around by calling the below HTTP call and compare it for each page on your end.
https://graph.microsoft.com/v1.0/me/onenote/pages/pageid/content
If you have tons of data, it would be better to raise a Uservoice for this scenario by going to the Microsoft Graph Feedback Forum so that it can be implemented in the future.

Embed a (public) tweet into Google Data Studio

I am attempting to embed a public tweet into a Google Data Studio page. Side note - I wanted to use it like a tool tip so when a viewer would hover over a data point, the tweet would pop up, but I don't think that's possible.
My main issue is that, when attempting a URL Embed, I keep getting the error "Can't embed due to provider site restrictions." I tried using oEmbed API but that just produced the error "Can't load site."
I feel like there has to be a workaround (I can't use community connectors due to security issues, and can't use anything paid) that I just haven't come across yet.
Does anyone have any experience or knowledge of whether embedding a tweet into GDS is possible?
This is not possible. Data Studio's URL Embed creates an HTML iframe with the src set to the provided URL and thus has the same restrictions than iframe has.
Twitter has set the Content-Security-Policy frame-ancestors directive to 'self' which prevents any other website from embedding their content.
For example, if you try it with https://wikipedia.org/ you'll see that the embed works because Wikipedia does not have this restriction.
The frame-ancestors directive restricts the URLs which can embed the resource using frame, iframe, object, embed, or applet element.
Source: https://w3c.github.io/webappsec-csp/#directive-frame-ancestors

Rails Feedzirra: Parse links from Feed entry titles

I have examined the object data of a Feedzirra::Feed.fetch_and_parse() object coming from a feed. The feed I'm using is http://feeds.feedburner.com/ChrisBurnor
My issue is that if a title on this page is linked to an external site Feedzirra does not pick up on it, in this case, the entry titled "Space Colony Art from the 1970's" links to publicdomainreview.com. Yet the link itself is not present anywhere in the Feedzirra returned object.
My question: Is there a known RSS element that contains the href material from an entry title?
Or: Is there a way I can examine the xml of this feed to see if I can perhaps find where the link is going...
For the future, I might want to peer inside of these links and include their material in my feed display but for now I just want to have the link.
On the feedburner page there is a link titled "View Feed XML". When opening it and then doing a "View Page Source" in your browser, you'll see the raw XML feed. But just using wget or curl seems to be less cumbersome to me.
If you look at the raw feed, you'll see that in there is no information or link about publicdomainreview.com.
So without further processing of the feed items, you can't easily get the information you want.

How to allow users to embed YouTube & Vimeo videos?

How can I go about allowing users to embed YouTube and Vimeo videos in my Rails app?
I'd provide a text field or text area where users can add the link of the video they wish to embed.
Click add and have my app show a spinner while the details are being gathered.
When the details are found, I'd want them displayed on the page before user can finally submit the post.
I'm guessing the HTML, link details will need to be stored in the database so the video can automatically be displayed every time the page is visited.
HTML5 has a file API that gives me the ability to display users local file data on the fly. Wondering if there is something similar for display remote data or would normal ajax be used?
Is there a standard way of doing this? Also are there any tutorials out there on how to do this in rails? Would like to go about doing this in the most safest and securest way.
I love tutorials and screencasts so I'd really be thankful for info on where I can find one to achieve what I'm trying to achieve.
Try to use open graph protocol to fetch site information before user sending the form.
I suggest the following gem:
https://github.com/intridea/opengraph
Open graph protocol:
http://ogp.me/
And I guess you should store all the fetched information in database.
The Video Thumb gem is probably what you are looking for.
It handles vimeo, youtube and potentially others.
Then you just do:
<%= VideoPlayer::player(library_item.url, 700, 420).html_safe %>
In your view to display an automatically generated embed code.

Is there a way to find all the pages' link by a URL?

If I have a link say http://yahoo.com/ so can I get the links inside yahoo? For example, I have a website http://umair.com/ and I know there are just 5 pages Home, About, Portfolio, FAQ, Contact so can I get links as follows programmatically?
http://umair.com/index.html
http://umair.com/about.html
http://umair.com/portfolio.html
http://umair.com/faq.html
http://umair.com/contact.html
Define what you mean by "links inside yahoo".
Do you mean all pages for which there is a link to on the page returned by "http://www.yahoo.com"? If so, you could read the HTML returned by an HTTP GET request, and parse through it looking for <a> elements. You could use the "HTML Agility Pack" for help.
If you mean, "All pages on the server at that domain", probably not. Most websites define a default page which you get when you don't explicitly request one. (for example, requesting http://umair.com almost certainly returns http://umair.com/index.html). Very few website don't define a default, and they will return a list of files.
If you mean, "All pages on the server at that domain, even if they define a default page", no that cannot be done. It would be an extreme breach of security.
This could be done by a Web Crawler, read some basic information about it:
http://en.wikipedia.org/wiki/Web_crawler
Includes Open Source crawlers, see if any of them is what you are looking for.

Resources