The Remote Content widget allows you to dynamically read every type of content picked from the web, incorporate text blocks, pictures, and more from external sources. This widget is compatible with REST APIs, including the native ones from WordPress, and allows to format the resulting value in JSON.
Embedded iFrame
Embed an external page (full content, style, javascript...) in a boxed iFrame on your page.
Removing the border will work as original content.
Web Scraping
Extract contents from other websites to integrate yours.
Set the URL page you want to scrap and enable "Incorporate in the page".
Your server will automatically fetch the entire Body of the external page and put it into the Widget body.
If you only need a single element of the page, you can filter it by setting a "Tag, ID or Class" related to the element you would like to use jQuery selector syntax.
Here we have some examples of selector that you can use:
Tags: for example "quote", "header";
ID: for example "#my-content" , #footer;
Class: for example ".block", ".site-body > .title".
Read more about selector syntax on https://www.w3schools.com/jquery/jquery_ref_selectors.asp
If there are several elements selected with set selector, you can define how many elements to display:
only the first one;
all of them;
the first ten results.
NOTE
Some sites do not allow this technique.
Pay attention to the original site data credits.
Rest API
Fetch JSON data result from remote service and print formatted contents.
First of all, set the URL of Endpoint you want to query, then enable "Incorporate in the page" and enable the JSON format for return data.
You can manage return data as:
a Single structure;
a repetitive block of an Archive with an initial structure;
The HTML representation of data is extremely malleable, you can build the main block with dynamic contents using Tokens.
Representative HTML code demo:
[DATA:title:rendered]
[DATA:excerpt:rendered]
HTML Manipulation
Fix Relative Links, if scraped HTML code has a relative link this setting will fix them transforming it into an absolute link.
Target Blank Links, if links are external, it adds automatically a target _blank attribute to the link tag;
Fix Lazy Images src, if the remote site uses the data-scr lazy load method then it converts to normal src on the images tag.
Cache
In order to perform a better page load is important to enable Cache, so your server will not fetch remote contents on every page load (summing time of remote page load + local page load) but will respond quickly with cached results that will refresh on every a set time expire limit.