I have a new, default install of Trix1.0. When I hit *61, it reads me the weather, but for an airport that's 800 miles from my office. I looked through the config files but could not find anything that blatantly looked like the config option for this. Can anyone tell me how to change the airport code for this option?
Thanks!
Weather (*61)
It's an AGI script. Check in your agi-bin directory. There are a couple of files which relate to this feature, but I think the only one you need to worry about is weather.agi ... I don't have a clue as to what the various citycodes are, but it lists ny for the current one. Maybe there's a list on the web somewhere?
EDIT: Just found this entry in the old Asterisk@Home forums:
In /var/lib/asterisk/agi-bin/weather.agi
my $custpath = "city/oh";
my $filename = "columbus.txt";
$AGI->exec('AGI',"festival-weather-script.pl|\"The latest weather forecast for Columbus Ohio. Press 1 to skip ahead.\"");
Edit the weather.agi changing
oh
columbus
Columbus Ohio
with your city and state
Credit to Jeff, whoever that is/was. :)
Undrhil
Thanks alot. It would have taken me a while to find that....
I don't know ... it was on the old A@H sourceforge forums. I'm sure you would have eventually gone there to look, right? I mean, it's in that "Newbies Read This" post at the top of the page ... Read the Documentation and go read the old Asterisk @ Home forums (30,000+ topics!) I got over there and did a search for weather and it was there.
Anyway, I've got mine working now too, pointing to Montgomery, AL! Yay! So, thank *you* for asking the question so I would go find the answer. ;)
Undrhil
You might want to check the nerdvittles site:
http://nerdvittles.com/index.php?p=136
It describes how to install the Flite speech synthesis engine which improves the speech quality and also describes a method of installing a database of all US airports.
:oops:UPDATE:oops:
The Flite system is already pre-installed on Trixbox but check out the article anyway!
Well, until I take my home pbx global, I only need the weather for Montgomery. Of course, once I get confortable with the basics, I'll work on learning PHP or perl so I can make an AGI to let me select a city from a prearranged list (so if I am going out-of-town, I can tell TrixBox the cities I'll be in and I can dial in and check the weather.)
Undrhil
It's already there for you in TrixBox. Just dial 611 on your wonderphone. And now you can expand it to support 1,000 airport codes in the U.S. Here's the link.
Does anyone know if its possible to get weather information for the UK?
Thanks
You'll have to check around on the web for a local weather website and see if there is any info on there for pulling the weather as a text document. Once you get it as a text document consistently, you should be able to modify the AGI script to work with that info instead of the NOAA info.
Undrhil
Hacking around a couple of other peoples scripts, including the original nv-weather, I have one which reads the BBC RSS feed for UK (and World) weather on extension 611.
Script and info:
http://www.mm-wave.com/asterisk
Lehane
The /var/lib/asterisk/agi-bin/weather.agi on the latest Trixbox does not work, the FTP URL is no longer available. Here is a working scripts as of 3Mar2007. To check availability ftp to tgftp.nws.noaa.gov and navigate to /data/forecasts/city directory there you will find the States and cities available.
----------------------------------------------------------------------------------------------
#!/usr/bin/perl -w
use Asterisk::AGI;
use Net::FTP;
my $AGI = new Asterisk::AGI;
my $server = "tgftp.nws.noaa.gov";
my $basepath = "/data/forecasts/city/in";
my $filename = "indianapolis.txt";
my @lines;
$AGI->exec('AGI',"festival-weather-script.pl|\"The latest weather forecast for Indianapolis. Press 1 to skip ahead.\"");
$ftp = Net::FTP->new($server, Debug => 0)
or die "Cannot connect to $server: $@";
$ftp->login("anonymous","thisoldman.com")
or die "Cannot login with anonymous/a\@b.com", $ftp->message;
$ftp->cwd("$basepath")
or die "Cannot change working directory ", $ftp->message;
$ftp->binary;
$ftp->get($filename,"/tmp/$filename.$$") || die "Error while downloading /tmp/$filename.$$!!!\n", $ftp->message;
open(INPUT,"
while() {
if(grep(/^\./,$_)) {
chomp($_);
$_ =~ s/^\.//;
push(@lines,$_);
print "$_\n";
}
}
for($i = 0; $i
$AGI->exec('AGI',"festival-weather-script.pl|\"$lines[$i]\"");
}
$AGI->exec('AGI',"festival-weather-script.pl|\"That concludes the extended weather forcast.\"");
$AGI->exec('AGI',"festival-weather-script.pl|\"Thank you for calling Concerto Networks.\"");
$AGI->exec('AGI',"festival-weather-script.pl|\"Goodbye.\"");
unlink("/tmp/$filename.$$");
exit;
-----------------------------------------------------------------------------------------
bhayler: "Does anyone know if its possible to get weather information for the UK?"
http://bestof.nerdvittles.com/applications/weather-world/ featuring London's Channel 4.
Weather by Zip Module v 1.1.5 Maintenance Release
Weather by Zip Module v 1.1.5 Released. Get it from the Devlopment Support Site here: http://projects.colsolgrp.net/projects/list_files/weatherzip
This is an optional maintenance release.
There are three changes in this maintenance release.
1. Ticket #118 Zip Codes Load fails on slow machines.
The initial installation of the zip code database could sometimes fail on some machines. This has been corrected - as the entire Zip Code DB should now load faster.
2. Ticket #148 Not using the proper database password
The module did use a hard coded database login/password instead of the one looked up from the file. This completes a previous patch that was supposed to have corrected this already.
3. Ticket #156 Create TTS folder where it does not exist
During module installation create TTS folder where it does not exist, and set with appropriate permissions. (such as trixbox, and elastix)
As always - let us know how this version works for you!
-tshif
Member Since:
2006-06-23