Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: WeatherUnderground - GetWeather Macro Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
npavkov
Groupie
Groupie


Joined: February 29 2004
Location: United States
Online Status: Offline
Posts: 91
Posted: August 08 2004 at 13:57 | IP Logged Quote npavkov

Dave... thanks for the help... I am working with the macro still, but I have a question...... is there a way of getting severe weather alerts from the cingular weather page????
Back to Top View npavkov's Profile Search for other posts by npavkov
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 02 2004 at 17:13 | IP Logged Quote dhoward

Nick,

Sorry to take so long getting back. Ive been dealing with the aftermath of Hurricane Charley and Im now preparing for Hurricane Frances.

Im not sure if severe weather alerts are available on the Cingular page or not. Im sure that it's possible to receive them either from Cingular or another dedicated weather page but would have to do a little research to find them. If you were able to locate a webpage that provided severe weather alerts, Im sure I could put a macro together for you that would allow it to be useful for you.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 06 2005 at 08:05 | IP Logged Quote TonyNo

A bit of an update: I just noticed that Weather Underground now has an RSS feed. This means that we could parse it instead of HTML or WAP code.

I think I may just work on a general purpose XML parsing macro!

Tony
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 06 2005 at 11:24 | IP Logged Quote dhoward

Ive been so busy I havent been able to even play with anything remotely related to RSS .

If you come up with something, be sure and post it as I would love to see it.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
fanningp
Groupie
Groupie
Avatar

Joined: December 01 2002
Location: United States
Online Status: Offline
Posts: 55
Posted: April 28 2005 at 21:33 | IP Logged Quote fanningp

Anyone have a GET WEATHER macro that will import correctly in the latest BETA? Seems the structure has changed a bit from the last posted example in this forum......

Pete
Back to Top View fanningp's Profile Search for other posts by fanningp Visit fanningp's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 28 2005 at 22:57 | IP Logged Quote TonyNo

Here is mine exported from the beta. You need these globals: TEMP STR, WEATHER STR. This gets the page twice, once for temp and humidity, and a second time for the forecast. Obviously, replace the ZIP code below with yours.

insert into macroheader values ('GET WEATHER','GET WEATHER',0,1,1);
insert into macrodetail values ('GET WEATHER',1,16,'',NULL,'if( {INTERNET FLAG}=0, 999, 1)',0);
insert into macrodetail values ('GET WEATHER',2,15,'[LOCAL1]',NULL,'mid( ph_geturl( "www.wunderground.com/cgi-bin/findweather/getForecast?query= 90210"), 20000, 30000)',0);
insert into macrodetail values ('GET WEATHER',6,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", "<b>", pos( "[LOCAL1]", "<font size=+2 face=arial><b>") +28) + 3',0);
insert into macrodetail values ('GET WEATHER',7,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "</b>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',8,15,'[LOCAL3]',NULL,'mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',9,15,'[LOCAL4]',NULL,'"The temperature is " + if( isnumber( "[LOCAL3]"), "[LOCAL3]", left( "[LOCAL3]", 2)) + " degrees, "',0);
insert into macrodetail values ('GET WEATHER',10,16,'',NULL,'if( pos( "[LOCAL1]", "Windchill") = 0, 5, 1)',0);
insert into macrodetail values ('GET WEATHER',11,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", "<nobr><b>", pos( "[LOCAL1]", "Windchill:</td>")) + 9',0);
insert into macrodetail values ('GET WEATHER',12,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "</b>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',13,15,'[LOCAL3]',NULL,'mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',14,15,'[LOCAL4]',NULL,'"[LOCAL4]" + "with a windchill of " + if( isnumber( "[LOCAL3]"), "[LOCAL3]", left( "[LOCAL3]", 2)) + ", "',0);
insert into macrodetail values ('GET WEATHER',15,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", "<b>", pos( "[LOCAL1]", "Humidity:</td>", [LOCAL2])) + 3',0);
insert into macrodetail values ('GET WEATHER',16,15,'[LOCAL3]',NULL,'mid( "[LOCAL1]", [LOCAL2], 3)',0);
insert into macrodetail values ('GET WEATHER',17,15,'[LOCAL4]',NULL,'"[LOCAL4]" + " and the humidity is " + if( isnumber( "[LOCAL3]"), "[LOCAL3]", left( "[LOCAL3]", 2)) + " percent. "',0);
insert into macrodetail values ('GET WEATHER',18,10,'TEMP STR',NULL,'"[LOCAL4]"',0);
insert into macrodetail values ('GET WEATHER',19,37,'',NULL,'',0);
insert into macrodetail values ('GET WEATHER',20,15,'[LOCAL1]',NULL,'mid( ph_geturl( "www.wunderground.com/cgi-bin/findweather/getForecast?query= 90210"), 50000, 30000)',0);
insert into macrodetail values ('GET WEATHER',21,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", ''<td align=left width="100%" >'') + 32',0);
insert into macrodetail values ('GET WEATHER',22,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "</b>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',23,15,'[LOCAL4]',NULL,'"The forecast for " + mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2] ) + " is "',0);
insert into macrodetail values ('GET WEATHER',24,15,'[LOCAL2]',NULL,'[LOCAL3] + 9',0);
insert into macrodetail values ('GET WEATHER',25,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "<br>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',26,15,'[LOCAL4]',NULL,'"[LOCAL4]" + mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER',27,15,'[LOCAL4]',NULL,'ph_replaceall( "[LOCAL4]", "...", ". " )',0);
insert into macrodetail values ('GET WEATHER',28,10,'WEATHER STR',NULL,'"[LOCAL4]"',0);

HTH,
Tony
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: April 29 2005 at 02:46 | IP Logged Quote krommetje

dhoward wrote:
Ive been so busy I havent been able to even play with anything remotely related to RSS .
If you come up with something, be sure and post it as I would love to see it.


Well, I host a page on my domain for www.wirelessnederland.nl to display RSS-feeds on a page www.krommetje.nl/wlnl
What I have done is Create a Javascript that redirects to:

http://www.rss2html.com/rss2html.php?TEMPLATE=template-1-4-1 .htm&XMLFILE=http://forum.wirelessnederland.nl/wlnl_rss.php

what is returned is a a webpage and like that we could filter out the html-code.

But TonyNo, I have imported your macro and I get and SQL-code 999 with an access violation or syntax error 24000

however, I've been looking at the RSS-feed and for the nearest I get this as an XML-File:

<rss version="2.0">








<channel>
<title>Weather Underground - Eindhoven, Netherlands</title>
      <link>http://www.w underg round.com/</link>
     <description>Weather Underground RSS Feed</description>
      <language>EN</l anguag e>
        <image>
                    <ur l>http://icons.wunderground.com/graphics/smash/wund erTransparent.gif</url>
                   <link>http://www.w underground.com</link>
                   <title> ;Weather Underground</title>       ;       </image>
      <category>weather& lt;/ca tegory>


<item>

                          <title>Eindhoven, Netherlands Current Conditions - 8:25 AM CEST Apr. 29</title>              <link>http://www.w underground.com/global/stations/0637 0.html</link>
      <description>Tempe rature : 55°F / 13°C | Humidity: 100% | Pressure: 30.06in / 1018hPa | Conditions: Light Rain | Wind Direction: SW | Wind Speed: 8mph / 13km/h | Updated: 8:25 AM CEST
     </description>
        <pubDate>Fri, 29 Apr 2005 06:25:00 GMT
        </pubDate>       &n bsp;   </item>


</channel>
</rss>

It would be easier to make a macro for just the values instead of this graphic page you normally get...

the link would be:

http://www.wunderground.com/auto/rss_full/global/stations/06 370.xm

When using my javaredirect, the resulting page is this:

<html>
<head>
<title>Weather Underground - Eindhoven, Netherlands</title>
<meta name="description" content="Weather Underground RSS Feed">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="http://www.rss2html.com/style4.css" rel=stylesheet type=text/css>
</head>
<body bgcolor="#FFFFFF" text="#336666" link="#009999" alink="#00FFFF" vlink="#66CCCC">
<h3 align="center">Weather Underground - Eindhoven, Netherlands</h3>
<h4 align="center"> Weather Underground RSS Feed <br>
</h4>
<p align="center"> <b>Last Updated:</b> Fri, 29 Apr 2005 03:28:40 +0000</p>

<table width="80%" border="0" cellspacing="0" cellpadding="20" align="center">
<tr valign="top">
    <td height="172">
      <p> </p>
      <div align="center"><b><a name=""></a></b>
        <table width="70%" border="0" cellspacing="2" cellpadding="4">
           <tr>
             <td width="63%" valign="top" height="62">
               <table width="100%" cellpadding="0" cellspacing="0" height="100%">
                <tr>
                    <td height="14">
                     <h3><a href="http://www.wunderground.com/global/stations/06370.html "><b>Eindhoven, Netherlands Current Conditions - 8:25 AM CEST Apr. 29</b></a></h3>

                   </td>
                </tr>
                <tr>
                    <td width="63%" valign="top"> Temperature: 55°F / 13°C | Humidity: 100% | Pressure: 30.06in / 1018hPa | Conditions: Light Rain | Wind Direction: SW | Wind Speed: 8mph / 13km/h | Updated: 8:25 AM CEST <br>
                     <font size="-2"><br>
                     04/29/2005 02:25 AM</font> </td>
                </tr>

               </table>
             </td>
           </tr>
        </table>
        </div>
    </td>
</tr>
</table>
<div align="center"><font face="Arial, Helvetica, sans-serif"><br>
<font size="-2">This page was created using RSS courtesy of <a href="http://www.feedforall.com">FeedForAll
</a></font></font></div>

</body>
</html>


Peter

Edited by krommetje
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 29 2005 at 08:09 | IP Logged Quote TonyNo

Whoops! I forgot to add that I have a flag check at the start, which looks at the gv INTERNET FLAG.

Something else is up, though, because I imported mine and it didn't work. I'll have to see what I did wrong!

Tony
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
fanningp
Groupie
Groupie
Avatar

Joined: December 01 2002
Location: United States
Online Status: Offline
Posts: 55
Posted: April 29 2005 at 19:30 | IP Logged Quote fanningp

Well...your macro imported just fine Tony and I've set all three GV's, but with INTERNET FLAG set to 1, the other two are getting the sentences without values, with my zip code all the proper places.

Pete
Back to Top View fanningp's Profile Search for other posts by fanningp Visit fanningp's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 30 2005 at 11:19 | IP Logged Quote TonyNo

That is what I was seeing. I'll need to dig into it this weekend.

Tony
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
fanningp
Groupie
Groupie
Avatar

Joined: December 01 2002
Location: United States
Online Status: Offline
Posts: 55
Posted: April 30 2005 at 22:05 | IP Logged Quote fanningp

I didn't mean to create more work for ya :).....

Or is this supposed to be fun?

Pete
Back to Top View fanningp's Profile Search for other posts by fanningp Visit fanningp's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 30 2005 at 22:18 | IP Logged Quote TonyNo

Heh! Fun, yeah, that's it!

I'm getting set to have more fun in my attic! My daughter likes how the bathroom and master bedroom are tied-in to the whole-house audio system, so, she asked me if I could hot-wire her room. I'm going to run line-level from my audio (linen) closet upstairs, down through one of her walls, and give her a jack that she can plug into with her speakers (I bought PC-type amplified speakers for the kids rooms a while ago so they could plug in their CD/MP3 players).

Tony
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: June 11 2005 at 10:59 | IP Logged Quote krommetje

TonyNo, did you get the chance to work on this Macro?

Cheerio
Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: June 11 2005 at 17:34 | IP Logged Quote TonyNo

Wow. I forgot about this!

See if this is any different. It's what I use now. You still need {TEMP STR} and {WEATHER STR}.

insert into macroheader values ('GET WEATHER A','GET WEATHER',0,0,1);
insert into macrodetail values ('GET WEATHER A',1,15,'[LOCAL1]',NULL,'mid( ph_geturl( "www.wunderground.com/cgi-bin/findweather/getForecast?query= 90210"), 20000, 30000)',0);
insert into macrodetail values ('GET WEATHER A',2,16,'',NULL,'if ( len( "[LOCAL1]" ) = 29999, 3, 1)',1);
insert into macrodetail values ('GET WEATHER A',3,1,'CHECK NET',0,'',1);
insert into macrodetail values ('GET WEATHER A',4,16,'',NULL,'999',1);
insert into macrodetail values ('GET WEATHER A',5,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", "<b>", pos( "[LOCAL1]", "<font size=+2 face=arial><b>") +28) + 3',0);
insert into macrodetail values ('GET WEATHER A',6,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "</b>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',7,15,'[LOCAL3]',NULL,'mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',8,15,'[LOCAL4]',NULL,'"The temperature is " + if( isnumber( "[LOCAL3]"), "[LOCAL3]", left( "[LOCAL3]", 2)) + " degrees, "',0);
insert into macrodetail values ('GET WEATHER A',9,16,'',NULL,'if( pos( "[LOCAL1]", "Windchill") = 0, 5, 1)',0);
insert into macrodetail values ('GET WEATHER A',10,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", "<nobr><b>", pos( "[LOCAL1]", "Windchill:</td>")) + 9',0);
insert into macrodetail values ('GET WEATHER A',11,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "</b>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',12,15,'[LOCAL3]',NULL,'mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',13,15,'[LOCAL4]',NULL,'"[LOCAL4]" + "with a windchill of " + if( isnumber( "[LOCAL3]"), "[LOCAL3]", left( "[LOCAL3]", 2)) + ", "',0);
insert into macrodetail values ('GET WEATHER A',14,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", "<b>", pos( "[LOCAL1]", "Humidity:</td>", [LOCAL2])) + 3',0);
insert into macrodetail values ('GET WEATHER A',15,15,'[LOCAL3]',NULL,'mid( "[LOCAL1]", [LOCAL2], 3)',0);
insert into macrodetail values ('GET WEATHER A',16,15,'[LOCAL4]',NULL,'"[LOCAL4]" + " and the humidity is " + if( isnumber( "[LOCAL3]"), "[LOCAL3]", left( "[LOCAL3]", 2)) + " percent. "',0);
insert into macrodetail values ('GET WEATHER A',17,10,'TEMP STR',NULL,'"[LOCAL4]"',0);
insert into macrodetail values ('GET WEATHER A',18,37,'',NULL,'',0);
insert into macrodetail values ('GET WEATHER A',19,15,'[LOCAL1]',NULL,'mid( ph_geturl( "www.wunderground.com/cgi-bin/findweather/getForecast?query= 90210"), 50000, 30000)',0);
insert into macrodetail values ('GET WEATHER A',20,15,'[LOCAL2]',NULL,'pos( "[LOCAL1]", ''<td align=left width="100%" >'') + 32',0);
insert into macrodetail values ('GET WEATHER A',21,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "</b>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',22,15,'[LOCAL4]',NULL,'"The forecast for " + mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2] ) + " is "',0);
insert into macrodetail values ('GET WEATHER A',23,15,'[LOCAL2]',NULL,'[LOCAL3] + 9',0);
insert into macrodetail values ('GET WEATHER A',24,15,'[LOCAL3]',NULL,'pos( "[LOCAL1]", "<br>", [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',25,15,'[LOCAL4]',NULL,'"[LOCAL4]" + mid( "[LOCAL1]", [LOCAL2], [LOCAL3] - [LOCAL2])',0);
insert into macrodetail values ('GET WEATHER A',26,15,'[LOCAL4]',NULL,'ph_replaceall( "[LOCAL4]", "...", ". " )',0);
insert into macrodetail values ('GET WEATHER A',27,10,'WEATHER STR',NULL,'"[LOCAL4]"',0);
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: June 12 2005 at 03:51 | IP Logged Quote krommetje

Hi TonyNo,

thanx for the code, now let's see if I can get something out of it....

Peter

Edited by krommetje
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 08 2005 at 08:12 | IP Logged Quote TonyNo

OK, darn it! PH is reporting a 404, but my browser gets it just fine. Is there something in the request sent by PH that they can be looking at and blocking?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 08 2005 at 10:18 | IP Logged Quote dhoward

Tony,

They very well could be checking something in the header or they may be using cookies (the ph_geturl function does not support cookies). The ph_geturl function uses a raw socket to form a valid http request. It does not analyze the returned results, so cant handle cookies and other directives.

As an alternative, you can try the ph_getitcurl function. This uses the Internet Transfer Control and supports cookies (it also appears just as if it were Internet Explorer). It takes an extra timeout parameter and does not return header information though so you'll have to change the parsing a little bit.

Ive also made available the ph_getwburl function. This is almost identical to the ph_getirturl but uses the Microsoft Web Browser control.

Ive tried to cover all the bases

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 08 2005 at 22:14 | IP Logged Quote TonyNo

Hmm. I think ZoneAlarm got paranoid.

More later...
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: November 08 2005 at 23:51 | IP Logged Quote TonyNo



That's what I get for mindlessly upgrading! Looks like v6 is a mixed bag... Some have no problem, some have HUGE problems!
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: November 10 2005 at 03:52 | IP Logged Quote krommetje

TonyNo wrote:


That's what I get for mindlessly upgrading! Looks like v6 is a mixed bag... Some have no problem, some have HUGE problems!


Well, I am still stuck and can't get it to work (and I don't use any firewall, just a hardware firewall just before my router)

Peter
Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 

<< Prev Page of 5 Next >>
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum