From 6cd1e21b3994911c0d3ec705168eb82d73e807a1 Mon Sep 17 00:00:00 2001 From: Momo Date: Fri, 5 Aug 2011 22:33:13 +0200 Subject: Added Kachelman to return the current weather situation --- kachelmann/conditions.pl | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 kachelmann/conditions.pl diff --git a/kachelmann/conditions.pl b/kachelmann/conditions.pl new file mode 100644 index 00000000..feabe6aa --- /dev/null +++ b/kachelmann/conditions.pl @@ -0,0 +1,6 @@ +#!/usr/bin/perl +use XML::Simple; +system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" > weather.xml"); +my $xml = new XML::Simple; +my $data = $xml->XMLin("weather.xml"); +print "Draussen ist $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; -- cgit v1.2.3 From f5d08ee4d24f4dfabbb20aad2f548e7d93f44d44 Mon Sep 17 00:00:00 2001 From: Momo Date: Fri, 5 Aug 2011 23:30:54 +0200 Subject: Changed the output --- kachelmann/conditions.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kachelmann/conditions.pl b/kachelmann/conditions.pl index feabe6aa..c61e0b8b 100644 --- a/kachelmann/conditions.pl +++ b/kachelmann/conditions.pl @@ -3,4 +3,4 @@ use XML::Simple; system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" > weather.xml"); my $xml = new XML::Simple; my $data = $xml->XMLin("weather.xml"); -print "Draussen ist $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; +print "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; -- cgit v1.2.3