weather

324 views
Skip to first unread message

iraqidonkey

unread,
Aug 1, 2010, 1:30:33 AM8/1/10
to Tasker
Okay, I am really new to this, and I have never programmed anything
like this. I am trying to make an alarm clock that will tell me the
weather for my current location. I have it so it will play music, and
say good prong, but I cannot figure out how to tell the current
conditions.

OriginalSource

unread,
Aug 1, 2010, 6:25:09 PM8/1/10
to Tasker
I'm also new to Tasker but an idea is you could use the HTTP Get
function as explained below to get the sunset times, just adapt it for
the weather if possible.

http://tasker.wikidot.com/http-get

Chris Andrews

unread,
Aug 4, 2010, 8:39:40 AM8/4/10
to Tasker
Hi,

I was fidgeting with this last night and came up with the following:

I wanted the phone to tell me todays forecast so I used the HTTP Get
task and entered

rss.wunderground.com/auto/rss_full/global/stations/02635.xml?
units=metric

Where 02635 is my location so you need to either hard code this to
your location or mix in a variable there if you want to be able to
change based on location etc. Also I use metric.

The easiest way to get the correct rss feed is to go to weather
underground.com and search for your location and look at the URL for
the resulting feed. The reason I chose weather underground instead of
Yahoo etc. was because the feed had the info I wanted for this
specific purpose.

in the Server:Port field, chose text/xml as Mime type.

This will create a Variable named %HTTPD

The next step is to split this variable into the parts you need, to do
this you need to find specific points of text in the feed you want to
use as a splitting point. This part is a little tricky and you end up
with a ton of different variables. There is probably a better way of
doing this but I'm just working with trial and error :)

For example: splitting %HTTPD results in two new variables: %HTTPD1
and %HTTPD2 if you then further split %HTTPD1 you end up with %HTTPD11
and %HTTPD12 if you split %HTTPD12 you get %HTTPD121 and %HTTPD122 and
so on.

As you can see you end up with a nice little mess of variables which
each contain a block of the text depending on where you split it.

Once I managed to split the text up in the chunks I wanted I created
the next task which in my case ended up being

Say: Today, %HTTPD22211, %HTTPD22212 degrees, Tonight, %HTTPD32211,
%HTTPD32212 degrees

In clear text it says Today, Partly Cloudy, High 22 degrees, Tonight,
Chance of Rain, Low 17 degrees
(Depending on the forecast of course)

The last thing I did in the task was to clear all the variables out so
that there is a clean slate for other tasks to use the HTTP Get
command.

Hope that helps get you started at least.




On Aug 1, 7:30 am, iraqidonkey <rihav...@gmail.com> wrote:
> Okay, I am really new to this, and I have never programmed anything
> like this. I am trying to make an alarm clock that will tell me theweatherfor my current location. I have it so it will play music, and

getfirefox

unread,
Aug 4, 2010, 9:56:49 PM8/4/10
to Tasker
On Aug 4, 8:39 am, Chris Andrews <andre...@gmail.com> wrote:
> The next step is to split this variable into the parts you need, to do
> this you need to find specific points of text in the feed you want to
> use as a splitting point. This part is a little tricky and you end up
> with a ton of different variables. There is probably a better way of
> doing this but I'm just working with trial and error :)


What do you enter into splitter?

Chris Andrews

unread,
Aug 5, 2010, 3:34:22 AM8/5/10
to Tasker
@getfirefox

I look through the feed in plain text and identify unique splitters.
for example if I run the HTTP Get and the feed is as below:


"Hello How are you getfirefox, I hope this example helps"

This will be the variable %HTTPD

Now if I want to split it I can enter any text it contains for example

Variable split %HTTPD
I enter "you" as the splitter in the text field

I get two new variables:

%HTTPD1 "Hello How are "
%HTTPD2 " getfirefox, I hope this example helps"

I can then further split %HTTPD2 by using "this" as the splitter and I
get:

%HTTPD21 " getfirefox, I hope "
%HTTPD22 " example helps"

and so on

(Note if you use a splitter that appears more than once in the text it
will split at all those places so it it occurs twice you will get 3
parts
%HTTPD1, %HTTPD2, %HTTPD3)

Hope this makes sense

Daniel

unread,
Aug 14, 2010, 4:02:59 PM8/14/10
to Tasker
@Chris Andrews,

Your post describing how to split variables was very helpful - it was
a great way to visualize what happens to the data as it is split.

I have a question/problem when it comes to splitting a weather xml
file. I am currently using (or trying to use)
http://weather.yahooapis.com/forecastrss?w=12769871 as my feed. I can
successfully isolate the lastBuildDate information and the city=" "
information. My problem occurs after this, I am wanting to isolate
the region=" " data and my popup skips to and says visibility=" ".

I will attempt to recreate the task below in hopes of you or someone
else being able to help me see where I've gone wrong:

HTTP GET:
Server/Port -> weather.yahooapis.com/forecastrss?w=12769871
Mime Type -> text/xml

VARIABLE SPLIT:
%HTTPD
Splitter -> <lastBuildDate>

VARIABLE SPLIT:
%HTTPD2
Splitter -> EDT

(%HTTPD21 now becomes the BuildDate)

VARIABLE SPLIT:
%HTTPD22
Splitter -> city="

VARIABLE SPLIT:
%HTTPD222
Splitter -> "

(%HTTPD2221 not becomes CITY for the forecast)

VARIABLE SPLIT:
%HTTPD2222
Splitter -> region="

VARIABLE SPLIT
%HTTPD22222
Splitter -> "

(%HTTPD222221 SHOULD, by my understanding become the STATE for the
forecast, rather it becomes "visibility=" as shown by my POPUP alert)

I would appreciate any guidance related to this.

Thank you.

BWL

unread,
Aug 30, 2010, 2:57:45 AM8/30/10
to Tasker
I'm trying to do something similar but use a different source (noaa).
I can't get it to split right...It splits fine within the <script>
tags, but once it gets below </script>, it no longer finds the
splitter even though it is there in the text. Prob should've gone with
a new thread, but I thought it was close enough to on topic to post
here,,,
Thanks


On Aug 14, 4:02 pm, Daniel <munkeema...@gmail.com> wrote:
> @Chris Andrews,
>
> Your post describing how tosplitvariables was very helpful - it was
> a great way to visualize what happens to the data as it issplit.
>
> I have a question/problem when it comes to splitting a weather xml
> file.  I am currently using (or trying to use)http://weather.yahooapis.com/forecastrss?w=12769871as my feed.  I can
> > for example if I run theHTTPGetand the feed is as below:
>
> > "Hello How are you getfirefox, I hope this example helps"
>
> > This will be the variable %HTTPD
>
> > Now if I want tosplitit I can enter any text it contains for example
>
> > Variablesplit%HTTPD
> > I enter "you" as the splitter in the text field
>
> > Igettwo new variables:
>
> > %HTTPD1 "Hello How are "
> > %HTTPD2 " getfirefox, I hope this example helps"
>
> > I can then furthersplit%HTTPD2 by using "this" as the splitter and I
> >get:
>
> > %HTTPD21 " getfirefox, I hope "
> > %HTTPD22 " example helps"
>
> > and so on
>
> > (Note if you use a splitter that appears more than once in the text it
> > willsplitat all those places so it it occurs twice you willget3
> > parts
> > %HTTPD1, %HTTPD2, %HTTPD3)
>
> > Hope this makes sense
>
> > On Aug 5, 3:56 am, getfirefox <getthei...@gmail.com> wrote:
>
> > > On Aug 4, 8:39 am, Chris Andrews <andre...@gmail.com> wrote:
>
> > > > The next step is tosplitthis variable into the parts you need, to do

DaWeav

unread,
Aug 30, 2010, 9:47:03 AM8/30/10
to Tasker
I used this for a very short and simple NOAA forecast.

Variable Split %LOC splitter ',' (a comma)

HTTP-GET from this NOAA website to get the extended forecast;
forecast.weather.gov/MapClick.php?lat=%LOC1&lon=%LOC2&TextType=1

Variable Split %HTTPD splitter 'Today: </b>'

Variable Split %HTTPD2 splitter '<br>'

Variable Set %ForecastForToday from %HTTPD21

Then I can do whatever I want to with %ForecastForToday. And also in
the %HTTPD returned code at the bottom there is the 'Point Forecast'
which has the 'City, St' of the location.

If I wanted to get the extended forecasts from the %HTTPD returned
code, then I guess it should be easy enough by way of using Tasker's
%DAYW variable to help split up the %HTTPD returned code.
Reply all
Reply to author
Forward
0 new messages