onenote snapshot intranet webpage - onenote

Is it possible to take a webpage snapshot of a non-public facing website (intranet) using the OneNote API?
I'm using the OneNote API to create OneNote notebooks, pages and sections. It's working well. Unfortunately, when I use data-render-src and point it to an intranet website, it fails to take a snapshot. The application is on the same intranet as the website I wish to capture.
Example HTML:
<!DOCTYPE html>
<html>
<head>
<title>A page with an image: Webpage capture zzzz</title>
<meta name="created" value="2015-11-11T12:45:00.000-8:00"/>
</head>
<body>
<p>This page displays an image of the webpage.</p>
<img data-render-src="https://intranet.website.com" width="800"/>
</body>
</html>
Note: I can take snapshots of publicly accessible websites.
Webpage snapshot description
https://learn.microsoft.com/en-us/graph/onenote-images-files#add-a-webpage-snapshot
Image rendered from html description
https://learn.microsoft.com/en-us/graph/onenote-images-files#add-an-image-rendered-from-html

I don't think it is - the OneNote aPI server will not have access to that page because it isn't public. You'll have to extract the HTML and send it over through the API instead of using data-render-src.

Related

HTML mobile redirection - avoid opening in the app

I have a website redirecting traffic to Kayak.com, lately I noticed users that have the Kayak app installed (iOS / Android) on their device, are being redirected to the app, instead of remaining in the browser.
Sometimes the users would get a question "Open in the kayak app?", while for others it will immediately open the Kayak app.
I wanted to ask how to disable this behavior?
I want all users to remain within the browser, just open the URL in the browser without opening the app (similar behavior to Desktop).
The HTML redirection code:
<!DOCTYPE html>
<html>
<head>
<h1> HTML redirection - how to avoid opening on the app / offering "open in the app?" </h1>
</head>
<body>
<meta http-equiv="Refresh" content="1;url=https://www.kayak.com" />
</body>
</html>
I don't have control of app installations or Kayak's website behavior.
I have tried replacing the HTML redirection with PHP redirection,
And tried JS redirection as well.
Both approaches result in the same outcome (opens in the app / offers to open the app).
For convenient testings I added this code to a web page :
http://www.hotels-bargains.com/htmlredirection.php
Any idea on how to keep the users inside the browser?

How do I send an image link through a golang created HTML page

I'm new to go and web apps and trying do write an app that reads menu items from a database and send the item's description and the link of a picture related to it through an HTML page for a browser. The app will run on a local network so the image will be in a place like "c:\images\01.png". As of now the page source created is something like
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p> Bolinho de Aipim<img src="01.png" alt="Ícone do Menu" width="42" height="42"></p>
<p> Bolinho de Bacalhau<img src="01.png" alt="Ícone do Menu" width="42" height="42"></p>
</body>
where 01.png is the picture file located on the same folder as the go serever app on the LAN server. Of course it will show the same file, but this is a test. In the real app there will be image folders and each item will have its corresponding image, of course.
Well, the page is created ,sent and shown correctly but the image is not shown. I believe this is an HTML problem, at which I'm not an expert, because if I change the src tag for anything online (e.g. the link to a picture on an Internet Server using http) the page created is able to fetch and exhibit the image properly.
Unfortunately I must be able to solve this problem without using any resource beyond the LAN to which the server and client browsers will be connected.
Thanks for any help.
You can add this piece of code in your server code to serve your images.
fs := http.FileServer(http.Dir("/path/to/images"))
http.Handle("/", fs)

Creating page API (through Graph) does not work

I'm trying to create pages using the beta API for OneNote (through Graph). Even though I've completely emptied out my OneNote (no notebooks), I still get 20117 - An item with this name already exists in this location. I've tested and I can create a Notebook just fine through this, but pages just refuse to be created (oddly enough, a default Notebook and Section will be created, but the page won't)
The URL I'm sending the POST to is: https://graph.microsoft.com/beta/me/notes/pages?sectionName=Quick%20Notes
The HTML content for the page I'm providing is:
<!DOCTYPE html>
<html>
<head>
<title>Testing Page</title>
<meta name="created" content="2015-07-22T09:00:00-08:00" />
</head>
<body>
yeaaaah
</body>
</html>

Share an image on Facebook and redirect to Fan Page

I am trying to share an image on Facebook via Email Marketing but I am having trouble to redirect after the share.
The code I insert in the email is:
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>My Title</title>
</head>
<body bgcolor='#eaeaea' style='font-family:Verdana'>
<div>
<a href='http://www.facebook.com/dialog/share?app_id=MY_APP_ID&href=URL_IMAGE&redirect_uri=https://www.facebook.com/FAN_PAGE&display=page'><div>Please share this image with your friends on Facebook:</div><BR><div><IMG SRC='URL_IMAGE'></a>
</div>
</body>
</html>
I get the error that I can't redirect to that URL.
I have configured in the APP the url of the website where is stored the image, but I am not able to redirect to the fan page on facebook.
I assume it is this error:
Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.
It seems that you can´t redirect directly to a facebook.com URL, you have to redirect to your own external website instead - and you have to add that URL/domain in your App settings. You could just implement a simple redirection from your external website to the fan page, as a workaround.

Html - Cannot load external http.jpg as image source

I want to load this external jpg in my webpage:
"http://ia.media-imdb.com/images/M/MV5BMjIxMjgxNTk0MF5BMl5BanBnXkFtZTgwNjIyOTg2MDE#._V1_SX300.jpg"
If I copy the link and put it in my chrome Browser, it opens the Poster.
But if I put it as a img src it does not load if I empty my cache before:
<!DOCTYPE HTML">
<html>
<head>
</head>
<body>
<img src="http://ia.media-imdb.com/images/M/MV5BMjIxNTU4MzY4MF5BMl5BanBnXkFtZTgwMzM4ODI3MjE#._V1_SX300.jpg" alt="no picture!" id="bild" height="400px"/>
</body>
</html>`
I get the following error:
Referral Denied
You don't have permission to access "http://ia.media-imdb.com/images/M/MV5BMjIxMjgxNTk0MF5BMl5BanBnXkFtZTgwNjIyOTg2MDE#._V1_SX300.jpg" on this server.
This sounds like they are checking the Referer: header sent by the web browser to determine whether the image is requested from one of their own web pages or from an external web page.
The IMDb Conditions of Use contains the following:
Framing: You may not frame or utilize framing techniques to enclose any trademark, logo, or other proprietary information (including images, text, page layout, or form) of IMDb without express written consent.
While you're welcome to link to IMDb's web pages (with appropriate attribution), I'm guessing that they don't want you to link directly to their images from your own web pages.