How to add XML data to Wix page? - html

I am trying to create a webpage or page element that will read and display the data from an external XML data feed. I can't seem to find documentation on their site that will help and I am very new to this.
This is the XML url generated: https://spacedout.ampsuite.com/xml/releases?cid=2&s_date=2018-01-01&e_date=2019-01-11&order=release_date&dir=desc&limit=10
And this is an example of how I would like it displayed: https://client.ampsuite.com/
Pretty much just the section under "featured releases" that lists current music releases.

You can use wixCode backend function in order to do that. All you need is to use the wix-fetch API to get the data, then you can parse the XML using xml-js (which is a node module you can install in the backend).
In your client code you'll need to call your backend function and then inject the results to something like a repeater / table element on your UI.

Related

How to print a file to an html page in django

I have a Django application where the logging is being printed to a file using the logging module.
I want to be able to have the contents of the log file also display on an html page such if a new line gets printed to the log page, the html page will also actively update to display the new line without having to be refreshed.
How can that be accomplished?
You need JavaScript for updating HTML without refreshing the page.
Create or edit the HTML with JavaScript and use AJAX for fetching latest logs every x seconds or how often you want the page to update. AJAX calls some Django view that returns the log data. For example, the view could read 10 latest lines from a log file and return that. JSON is probably the easiest format to work with but any format is fine (doesn't have to be XML like in the picture).
Tutorial for doing something like this with Django + jQuery
Depending on how complicated the logging page is, you may want to check out Django's documentation for JavaScript, storing JavaScript files in the project if JS code is not just in the HTML files, Django Rest Framework and different JavaScript libraries/frameworks such as React or Vue.

Node.js Web Crawling - How to get all data loaded in HTML?

I am trying to use Node.js to implement Data Scrawling. I used axios to GET HTML file and use cheerio to get data.
However, I found that the HTML doesn't return with data but only layout. I guess the website with load the layout first, then doing ajax things to query data then rendering.
So, Anyone know how to GET the full HTML with data? Any library or tools?
Thanks.
i would suggest you to use selenium library with bs4 library in python if have some experience on python.
for node
https://www.npmjs.com/package/selenium-webdriver
i have written scraper in python using both library.
scraper is for linked in profile which take name from excel file and search if data available add it into another excel file
https://github.com/harsh4870/Scraper_LinkedIn
for node code goes like
driver = webdriver.Firefox();
driver.get("http://example.com");
html = driver.getPageSource();

GetOrgChart JSON format

A little startup I am doing work for is searching for a JavaScript Org Chart, and we believe we'd like to use "GetOrgChart" from getorgchart.com.
We definitely have a working back-end already that provides data to the front-end via RESTful services and provides JSON data.
We know the GetOrgChart can be loaded with data from various sources, and in this case we'd like to know what format the JSON has to be in?
Are there any examples out there of how the JSON should look like?
We'd definitely like to download and register this product, but that is one of the questions we'd like to get answered.
Thanks!
On their demos page, you can click the 'Get HTML Code' link (upper right, below the site header) which opens the javascript used to render the demo, including the format of the data.

Howto style a Resultpage of a Connector?

I have created a "connector" with a very nice tool called import.io which allows me to do a search inquiry by a other website and gets me an resultlist. I followed an other article by stackoverflow.com to do this:
basic import.io html search
This works well. But my question now:
How i style my HTML(Resultlist) with CSS like on this site?
Thanks
To get the data from your API into a web page you need to access the API via a programming language or script. Once you have the API return the Data as Json, you could try something like http://json2html.com/ to convert the Data into HTML and write that to your page.
Alternatively you could download the data as CSV, open it in excel and wrap html tags around the data and copy paste that into your website. its not idea, but at least you can get the data online.

Load different contents in HTML when selecting different options in drop-down list

I'm going to build a web UI for a system originally using command lines. People will use this web UI to select options from drop-down lists and submit their requirements.
Here's a feature I would like to implement: options are stored in XML files, when people select a top-level option in the drop-down list, the web page could load automatically the contents in a corresponding XML file, and display the sub-level options contained in this file.
I'm new to HTML and XML, after some research I think it may be related to XML and DOM but I'm not sure. Could you please give some examples or tutorials of this feature?
Jquery's AJAX and GET - Method is very useful for things like this: http://api.jquery.com/jQuery.ajax/
With these, you can make a specific query to a specific file on a server. Via a parameter, you can specify, which item you want to have as a response.
$.get("backend.php", { item: "1" }) //Pull menu item 1 from server
.done(function(data) {
$("#menuitem").html(data); //Place Data in html menu here
});
It is common to transmit the data in the JSON - Format to the server, with json encode you can do this with PHP:
http://php.net/manual/de/function.json-encode.php