Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 526

Help: Rainmeter Skins • WebParser XMLHttpRequest for weather forecast

$
0
0
Dear Team,

I'd like to use WebParser to call in principle this page and collect/parse specific weather data (hourly UV-index and cloud cover):
https://14-tage-wettervorhersage.de/wetter/paris/stuendlich/623/

In the page source I found this section describing the fetchURL with the required parameters (here for Paris/France as an example):

Code:

function loadNext(pagination) {var fetchURL = '/get/get_hourly_next.php';    const params = new URLSearchParams();        params.append('cityid', '623');    params.append('city', 'paris');    params.append('tab', 'stuendlich');        if (pagination !== 0) {        params.append('s', pagination);    }fetch(fetchURL, {method: 'POST',headers: {'X-Requested-With': 'XMLHttpRequest','Content-Type': 'application/x-www-form-urlencoded',},body: params}).then(response => response.text())  .then(html => {
This XMLHttpRequest obviously pulls the hourly weather data I'm interested in, found in tables towards the end of the page source. I'm focused on the "drawWolken"-datatable: This is the data I would like to parse and display in a Rainmeter gadget ==> Cloud cover in % und the UV-index for the coming 24 hours.

Code:

function drawWolken() {var dataTable = new google.visualization.DataTable();dataTable.addColumn('string', 'Stunde');dataTable.addColumn('number', 'Wolken');// A column for custom tooltip contentdataTable.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});dataTable.addColumn('number', 'UV-Index');// A column for custom tooltip contentdataTable.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});dataTable.addRows([['Do. 22:00',57,'57 %',0,'0 (Niedrig)'],['Do. 23:00',84,'84 %',0,'0 (Niedrig)'],['Fr. 00:00',80,'80 %',0,'0 (Niedrig)'],['Fr. 01:00',76,'76 %',0,'0 (Niedrig)'],['Fr. 02:00',84,'84 %',0,'0 (Niedrig)'],['Fr. 03:00',92,'92 %',0,'0 (Niedrig)'],['Fr. 04:00',100,'100 %',0,'0 (Niedrig)'],['Fr. 05:00',100,'100 %',0,'0 (Niedrig)'],['Fr. 06:00',100,'100 %',0,'0 (Niedrig)'],['Fr. 07:00',100,'100 %',0,'0 (Niedrig)'],['Fr. 08:00',100,'100 %',0,'0 (Niedrig)'],['Fr. 09:00',100,'100 %',0,'0 (Niedrig)'],['Fr. 10:00',100,'100 %',1,'1 (Niedrig)'],['Fr. 11:00',99,'99 %',1,'1 (Niedrig)'],['Fr. 12:00',99,'99 %',1,'1 (Niedrig)'],['Fr. 13:00',94,'94 %',1,'1 (Niedrig)'],['Fr. 14:00',84,'84 %',1,'1 (Niedrig)'],['Fr. 15:00',76,'76 %',2,'2 (Niedrig)'],['Fr. 16:00',76,'76 %',1,'1 (Niedrig)'],['Fr. 17:00',76,'76 %',1,'1 (Niedrig)'],['Fr. 18:00',76,'76 %',0,'0 (Niedrig)'],['Fr. 19:00',37,'37 %',0,'0 (Niedrig)'],['Fr. 20:00',40,'40 %',0,'0 (Niedrig)'],['Fr. 21:00',42,'42 %',0,'0 (Niedrig)'],]);
Now the question: How do I need to construct a WebParser call to pull exactly this datatable?

Help is much appreciated... I'm not a specialist in php unfortunately...

Statistics: Posted by emp00 — Yesterday, 9:14 pm



Viewing all articles
Browse latest Browse all 526

Trending Articles