Wie macht Ich den data.xml

Fragen, Anregungen zur PC-Wetterstations-Software

Moderatoren: Werner, Tex, weneu

Antworten
Fredens

Wie macht Ich den data.xml

Beitrag von Fredens »

Hallo Freunde,

Meine deutsch ist nicht gut so Ich hoffe englisch im Forum ist okay und dass einer in englisch anworte kann.

Danke in vorraus

I would like to make a xml feed of my weather data, but reading all the german technial text (and somewhat cofusing english manual) I'm quite in doubt in how to do it so I hope someone here can help me.

I've managed to make a wml file, but I would also like to make a xml file.

Hoping for an answer

Der Däne
rabit
Beiträge: 324
Registriert: 16 Dez 2001 01:00
Wohnort: Mannheim
Kontaktdaten:

Beitrag von rabit »

Hi,

you need a file like thie http://aktuell.mannheim-wetter.info/rss.xml.

To generate such a file use the custom file engine for the WAP files but don´t use wml spezific tags. The WAP file engine generates files without additional (html..) tags.
Viele Grüße aus Mannheim
gerhard

Bild
Davis VP2 > Weather Envoy > Weatherlink > WSWIN
Davis VP2 > Weather Envoy > Meteohub > Meteoplug
Fredens

Beitrag von Fredens »

Hi,

Thanks for answering!

Is it possible that you could post the first 10-15 lines of a wap.txt file that generates a xml file. Just so I can get an idea?

Thanks
rabit
Beiträge: 324
Registriert: 16 Dez 2001 01:00
Wohnort: Mannheim
Kontaktdaten:

Beitrag von rabit »

wap.txt: (generates the file wetter.wml, opens the second template rsscript.txt)

Code: Alles auswählen

%customfile=wetter.wml%
%openfile=rssscript.txt%
///<xml>
///<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML
......code for the wetter.wml file
 
The second template:
rssscript.txt (generates the file data.xml, and opens the third template rss2script)

Code: Alles auswählen

///<customfile>
%openfile=rss2script.txt%
%unit_on%<xml>
///<xml>
///<rss>
<channel>
<title>Wetterwerte aus Mannheim</title>
<link>http&#58;//www.mannheim-wetter.info</link>
<description>Das Wetter aus Mannheim und Umgebung mit Daten der eigenen Wetterstation und WebCam</description>
<language>de-de</language>
<copyright>2004 mannheim-wetter.info</copyright>
<image>
<url>http&#58;//www.mannheim-wetter.info/wetter/pcws/%forecast_icon%</url>
<title>Aktuelles Wetter</title>
<link>http&#58;//www.mannheim-wetter.info</link>
</image>
<item>
<title>%ws_time%&#58; Temperatur&#58; %curval&#91;2&#93;% </title>
<description>Am %ws_date% um %ws_time% lag die Außentemperatur bei %curval&#91;2&#93;%. Änderung in der letzten Stunde&#58; %curminmaxhour&#91;4,1,2&#93;%.</description>
<link>http&#58;//www.mannheim-wetter.info</link>
</item>
<item>
<title>%ws_time%&#58; Luftdruck&#58; %curval&#91;33&#93;% </title>
<description>Am %ws_date% um %ws_time% Uhr war der Luftdruck bei %curval&#91;33&#93;%. Die Änderung betrug %ws_baro3h%. </description>
<link>http&#58;//cam.mannheim-wetter.info</link>
</item>
<item>
<title>%ws_time%&#58; Niederschlag&#58; %rainday% </title>
<description>Am %ws_date% um %ws_time% Uhr gab es seit Mitternacht %rainday% Niederschlag. Innerhalb der letzten 24h waren es %rain24h%. Im aktuellen Monat waren es bis jetzt %rainmonth%</description>
<link>http&#58;//grafik.mannheim-wetter.info</link>
</item>
<item>
<title>%ws_time%&#58; Vorhersage&#58; %forecast_txt% </title>
<description>Basierend auf den aktuellen Temperatur und Luftdruckwerten soll es innerhalb der nächsten 24h %forecast_txt% werden.</description>
<link>http&#58;//www.mannheim-wetter.info/vorhersage.shtml</link>
</item>
</channel>
</rss>
The first wap-template is always a file called "wap.txt"!
The lines with "///" are wrong. However. Take a look in my original rss.xml for the correct code.
Viele Grüße aus Mannheim
gerhard

Bild
Davis VP2 > Weather Envoy > Weatherlink > WSWIN
Davis VP2 > Weather Envoy > Meteohub > Meteoplug
Fredens

Beitrag von Fredens »

I still dont get it - sorry

Here is my the first part of my wap.txt

Code: Alles auswählen

%customfile=index.wml% 
%openfile=data.txt% 
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http&#58;//www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card id="Aktuell" title="%ws_location%">
    <p align="left">
           <b><big>Fredensvejr</big></b><br/>
Here is the first part of the data.txt file:

Code: Alles auswählen

%unit_on%<xml> 

  %customfile=fredens.xml% 
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!--  encoding="UTF-8" internationaler CharSet auf Basis der ISO/IEC-10646-Norm mit 8 Bit Zeichenbreite  -->  
<!--  encoding="UTF-16" internationaler CharSet auf Basis der ISO/IEC-10646-Norm mit 16 Bit Zeichenbreite -->  
<!--  encoding="ISO-8859-1"  ISO-CharSet westeuropaeische Sprachen  -->
<!--  encoding="ISO-8859-2"  ISO-CharSet osteuropaeische Sprachen  -->
<!--  encoding="ISO-8859-3"  ISO-CharSet südeuropaeische Sprachen  -->
<!--  encoding="ISO-8859-4"  ISO-CharSet nordeuropaeische Sprachen  -->
<!--  encoding="ISO-8859-5"  ISO-CharSet kyrillische Sprachen siehe  -->
<!--  encoding="ISO-8859-6"  ISO-CharSet arabische Sprachen siehe  -->
<!--  encoding="ISO-8859-7"  ISO-CharSet griechische Sprache siehe  -->
<!--  encoding="ISO-8859-8"  ISO-CharSet hebraeische Sprache siehe  -->
<!--  encoding="ISO-8859-9"  ISO-CharSet tuerkische Sprache siehe  -->
<!--  encoding="ISO-8859-10" ISO-CharSet nordische Sprache  -->


<WXDATA>
 <PARAM>

<!--  List of supported variables / Liste der unterstützen Variablen .............................   -->
<!--  %shortslabel&#91;x&#93;%  -->
<!--  %longslabel&#91;x&#93;%  -->
<!--  %curval&#91;x&#93;%  -->
But all it does is (make the index.wml which is ok) but also a custom.wml with the data that should be an xml file with the name of "fredens.xml".

Many thanks for your patience ;-)
rabit
Beiträge: 324
Registriert: 16 Dez 2001 01:00
Wohnort: Mannheim
Kontaktdaten:

Beitrag von rabit »

%customfile.... muss be in the first line!
%openfile.... in the second
and then the rest.

Bild
Viele Grüße aus Mannheim
gerhard

Bild
Davis VP2 > Weather Envoy > Weatherlink > WSWIN
Davis VP2 > Weather Envoy > Meteohub > Meteoplug
Fredens

Beitrag von Fredens »

Fantastic!!

It works!
http://www.elgum.dk/vejr/fredens.xml


Thanks a lot :D
Antworten