From 6f683003c47c43c8842c071f81898c36ff348ce0 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Aug 2011 00:25:26 +0200 Subject: Added Kachelmann for weathermonitoring --- kachelmann/conditions.pl | 7 +++++++ kachelmann/weather.xml | 1 + 2 files changed, 8 insertions(+) create mode 100755 kachelmann/conditions.pl create mode 100644 kachelmann/weather.xml (limited to 'kachelmann') diff --git a/kachelmann/conditions.pl b/kachelmann/conditions.pl new file mode 100755 index 00000000..61c43330 --- /dev/null +++ b/kachelmann/conditions.pl @@ -0,0 +1,7 @@ +#!/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"); +my $sentence = "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; +system("espeak \"$sentence\""); diff --git a/kachelmann/weather.xml b/kachelmann/weather.xml new file mode 100644 index 00000000..8a785308 --- /dev/null +++ b/kachelmann/weather.xml @@ -0,0 +1 @@ + -- cgit v1.2.3 From 2432589707a1153c14de4d43533a1a3bc31dbc9e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Aug 2011 00:36:40 +0200 Subject: Changed kachelmann to write its XML file to /tmp/kachelmann/weather.xml Deleted Weather.xml Added a Makefile --- kachelmann/Makefile | 5 +++++ kachelmann/conditions.pl | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 kachelmann/Makefile (limited to 'kachelmann') diff --git a/kachelmann/Makefile b/kachelmann/Makefile new file mode 100644 index 00000000..277a5421 --- /dev/null +++ b/kachelmann/Makefile @@ -0,0 +1,5 @@ +.PHONY: infect +INSTALL_DIR = /root/bin +infect: + mkdir -p /tmp/kachelmann/ + cp kachelmann ${INSTALL_DIR} diff --git a/kachelmann/conditions.pl b/kachelmann/conditions.pl index 61c43330..6d8b5541 100755 --- a/kachelmann/conditions.pl +++ b/kachelmann/conditions.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl use XML::Simple; -system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" > weather.xml"); +system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" > /tmp/kachelmann/weather.xml"); my $xml = new XML::Simple; -my $data = $xml->XMLin("weather.xml"); +my $data = $xml->XMLin("/tmp/kachelmann/weather.xml"); my $sentence = "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; system("espeak \"$sentence\""); -- cgit v1.2.3 From 66cf9c25fff2686c90a632422386f17bd835243e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Aug 2011 01:27:55 +0200 Subject: Fixed the Makefile and renamed conditions.pl to conditions --- kachelmann/Makefile | 5 +++-- kachelmann/conditions | 7 +++++++ kachelmann/weather.xml | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100755 kachelmann/conditions delete mode 100644 kachelmann/weather.xml (limited to 'kachelmann') diff --git a/kachelmann/Makefile b/kachelmann/Makefile index 277a5421..813f4dec 100644 --- a/kachelmann/Makefile +++ b/kachelmann/Makefile @@ -1,5 +1,6 @@ .PHONY: infect -INSTALL_DIR = /root/bin +INSTALL_DIR = /root/bin/ infect: mkdir -p /tmp/kachelmann/ - cp kachelmann ${INSTALL_DIR} + cp conditions ${INSTALL_DIR} + chmod +x ${INSTALL_DIR}conditions diff --git a/kachelmann/conditions b/kachelmann/conditions new file mode 100755 index 00000000..6d8b5541 --- /dev/null +++ b/kachelmann/conditions @@ -0,0 +1,7 @@ +#!/usr/bin/perl +use XML::Simple; +system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" > /tmp/kachelmann/weather.xml"); +my $xml = new XML::Simple; +my $data = $xml->XMLin("/tmp/kachelmann/weather.xml"); +my $sentence = "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; +system("espeak \"$sentence\""); diff --git a/kachelmann/weather.xml b/kachelmann/weather.xml deleted file mode 100644 index 8a785308..00000000 --- a/kachelmann/weather.xml +++ /dev/null @@ -1 +0,0 @@ - -- cgit v1.2.3 From 925e7b3da5cd12734d66201b95744ef5f9c09917 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Aug 2011 01:31:44 +0200 Subject: Mde the Makefile to rename conditions to kachelmann in /root/bin --- kachelmann/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kachelmann') diff --git a/kachelmann/Makefile b/kachelmann/Makefile index 813f4dec..7fa3ec2d 100644 --- a/kachelmann/Makefile +++ b/kachelmann/Makefile @@ -3,4 +3,6 @@ INSTALL_DIR = /root/bin/ infect: mkdir -p /tmp/kachelmann/ cp conditions ${INSTALL_DIR} - chmod +x ${INSTALL_DIR}conditions + mv ${INSTALL_DIR}conditions ${INSTALL_DIR}kachelmann + chmod +x ${INSTALL_DIR}kachelmann + -- cgit v1.2.3 From 135bdbc139f1aefb8d05d2de5e01e52982f4437a Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Aug 2011 01:34:09 +0200 Subject: Made kachelmann speak german --- kachelmann/conditions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kachelmann') diff --git a/kachelmann/conditions b/kachelmann/conditions index 6d8b5541..9880b397 100755 --- a/kachelmann/conditions +++ b/kachelmann/conditions @@ -4,4 +4,4 @@ system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" my $xml = new XML::Simple; my $data = $xml->XMLin("/tmp/kachelmann/weather.xml"); my $sentence = "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; -system("espeak \"$sentence\""); +system("espeak -v de \"$sentence\""); -- cgit v1.2.3 From 1318d17d4908f5213da91e424b5f574e159ffd11 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Aug 2011 01:36:29 +0200 Subject: Edited the output so espeak can pronounce it --- kachelmann/conditions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kachelmann') diff --git a/kachelmann/conditions b/kachelmann/conditions index 9880b397..1a798e42 100755 --- a/kachelmann/conditions +++ b/kachelmann/conditions @@ -3,5 +3,5 @@ use XML::Simple; system("w3m -dump \"http://www.google.com/ig/api?weather=70327-stuttgart&hl=de\" > /tmp/kachelmann/weather.xml"); my $xml = new XML::Simple; my $data = $xml->XMLin("/tmp/kachelmann/weather.xml"); -my $sentence = "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Celsius\n"; +my $sentence = "Die Wetterkondition ist: $data->{weather}->{current_conditions}->{condition}->{data}\n bei $data->{weather}->{current_conditions}->{temp_c}->{data} Grad Zelsius\n"; system("espeak -v de \"$sentence\""); -- cgit v1.2.3