Hi everybody, I'm new to these forums and this is my first post. A couple days ago I was trying to find a simple script that would return an individual's local weather conditions using I.P. based geolocation. After many failed search attempts, I began my quest to create this for myself. I have to admit, it was a bit of a challenge for me as I'm very new to doing "cool" things on the command line. However, though the process of trial and error I have prevailed. Here is what I came up with:
This script will return your current local weather conditions as well as a four day forecast. As you can see, the script utilizes CURL, SED and XMLStarlet. As of right now, this is the best I could do.
Can you do better? Let's see how small and simple we can get this script, because it has the potential to develop into something useful for many people. If you find this challenge too simple for your master skills than perhaps you might like to take this script to the next level and add some features. Whatever the case may be, I look forward to your input.
Thanks,
Jared
Last edited by o0110o; 02-11-2010 at 07:53 PM..
Reason: Typo
Hi all,
Please tell me how to verify weather it is a ebcdic file or not . I checked with file commond but it is giving like International Language text.
Regards,
Chaitu (0 Replies)
Hi,
Hi want to check weather a file is being used by using a command or java code or shell script.
So, can any body give me some idea..
Thanks
Buddhika (3 Replies)
#!/bin/sh
#Argentina Only :s
# This script requires curl and iconv, iconv is because they do not use Weather Service utf-8 ¬¬
# 87938 = Ushuaia
# 87934 = Rio Grande
# 87418 = Mendoza
# 87582 = Capital Federal
# 87692 = Mar del Plata
# 87480 = Rosario
# 87344 = Cordoba
# 87371 = Santa Fe
... (8 Replies)
Discussion started by: yamirokuay
8 Replies
LEARN ABOUT DEBIAN
weather::com::uvindex
Weather::Com::UVIndex(3pm) User Contributed Perl Documentation Weather::Com::UVIndex(3pm)NAME
Weather::Com::UVIndex - class containing the uv index data
SYNOPSIS
#!/usr/bin/perl -w
use Weather::Com::Finder;
# you have to fill in your ids from weather.com here
my $PartnerId = 'somepartnerid';
my $LicenseKey = 'mylicense';
my %weatherargs = (
'partner_id' => $PartnerId,
'license' => $LicenseKey,
'language' => 'de',
);
my $weather_finder = Weather::Com::Finder->new(%weatherargs);
my @locations = $weather_finder->find('Heidelberg');
my $currconditions = $locations[0]->current_conditions();
print "The current uv index is ", $currconditions->uv_index()->index(), "
";
print "This is relatively ", $currconditions->uv_index()->description(), "
";
DESCRIPTION
Via Weather::Com::UVIndex one can access the uv index and its description (whether it's high or low). An uv index is usually an object
belonging to current conditions or to a forecast (not implemented yet).
This class will not be updated automatically with each call to one of its methods. You need to call the "uv_index()" method of the parent
object again to update your object.
CONSTRUCTOR
You usually would not construct an object of this class yourself. This is implicitely done when you call the uv_index() method of one cur-
rent conditions or forecast object.
METHODS
index()
Returns the uv index (number).
description([$language])
Returns the description whether this index is high or low.
This description is translated if you specified the language option as argument while instantiating your Weather::Com::Finder.
This attribute is dynamic language enabled.
AUTHOR
Thomas Schnuecker, <thomas@schnuecker.de>
COPYRIGHT AND LICENSE
Copyright (C) 2004-2007 by Thomas Schnuecker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The data provided by weather.com and made accessible by this OO interface can be used for free under special terms. Please have a look at
the application programming guide of weather.com (<http://www.weather.com/services/xmloap.html>)!
perl v5.8.8 2007-07-09 Weather::Com::UVIndex(3pm)