Page 1 of 2 12>
Topic Options
#99569 - 2003-03-14 07:22 PM Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
Hey guys,
I had a crazy idea of showing a graphic of a Sun (sunny), a sun and clouds (partly cloudy) and a picture of rain (duh) as a side form predicting the weather as the user logs into the network..

I wonder if there is some automated weather service that I can pass the variables from.. Anyone ever try anything like this before?

Also, What's the best way to trap the time of day (morning, noon, night) into a variable.. I did it, but it's pretty messy with way too many if statements.

Top
#99570 - 2003-03-14 07:33 PM Re: Weather Report
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Maybe you should let Merlin or Genie do the weather forecast [Big Grin]

There are some sample code fragments and/or complete scripts in Scripts and COM to search for [Wink]
_________________________



Top
#99571 - 2003-03-14 07:50 PM Re: Weather Report
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
something like this:

http://oap.weather.com/fcgi-bin/oap/generate_magnet?loc_id=33569

change the numbers at the end to your zip code
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#99572 - 2003-03-14 09:21 PM Re: Weather Report
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Maybe you could even embed this into a KiXForms object?
_________________________
There are two types of vessels, submarines and targets.

Top
#99573 - 2003-03-14 09:48 PM Re: Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
That picture is perfect.. That was exactly what I was looking for - Thanks Ramius!

Now, how would I fire up a small kixforms window with that information in it when the user logs in?

Should I fire up IE as a com object and navigate to that site?

I'm getting geeked about this now since we are a shipping copnay and I want to have the weather for all of our ports listed during login in small boxes.. Very cool.

Top
#99574 - 2003-03-14 10:07 PM Re: Weather Report
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I'd go with a kixform with a combobox / option button that would provide the weather for the selected area
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#99575 - 2003-03-14 10:26 PM Re: Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
This is going to sound really stupid, but I am just getting a novice handle with scripting with forms and objects.

I am trying to figure out how to get a box - the size of the weather channel page that you listed above into a box without it looking like a browser window and withoud dead space..

When I create an IE application object and use the navigate command, does that object become whatever the web page is that I specify as the URL?? Is that something I can embed into a KIX form? How could I get a web page to be an object that I can place in a form? Am I even on the right path??

I'm so damn confused..

Top
#99576 - 2003-03-15 12:13 AM Re: Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
* Bump *
Top
#99577 - 2003-03-15 02:37 AM Re: Weather Report
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Any reason for the bump?

You might want to pull a webpage into a string, then parse the string for e.g. the graphic file that's being displayed. Then pull the graphic file to a local directory and display it in KiXForms. Definitley doable.
_________________________
There are two types of vessels, submarines and targets.

Top
#99578 - 2003-03-16 05:48 PM Re: Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
I just need a little help because I never did that before..

IS there a step by step help file that covers that or an example someone can post to get me started? Any help would be greatly appreciated.

Thanks!

Top
#99579 - 2003-03-17 12:48 AM Re: Weather Report
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
the gurus chatted about this last night. there is no easy way for this to work yet, but Shawn mentioned the the best way for this to work is to build into kforms access to the IE activex control (or something to that effect)

so right now, you may need to kludge something (perhaps some IE wizard to pull the magnet jpgs on a daily basis)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#99580 - 2003-03-17 05:35 AM Re: Weather Report
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
IE's xmlhttp-object and kixforms mixed would get to the goal but that is far from simple.
that also requires power user rights for each user to make sure it works (may need to register kixforms.dll)
_________________________
!

download KiXnet

Top
#99581 - 2003-03-17 05:52 PM Re: Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
I have registered the Kixforms.dll on every station as a preperation of what I am attempting to accomplish.

How would I trap the webpage into a string?

$IE.Navigate("http://blahblah.com") or something simmilar?

Top
#99582 - 2003-03-17 05:57 PM Re: Weather Report
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Here is something Jooel put together for me. If you leave out the nested Split() functions, it would pull the body.
code:
break on 
$http=createobject("microsoft.xmlhttp")
$http.open("GET","http://chart.canada-stockwatch.com/sw/chart.dbm?symbol=A",not 1)
$http.send
$value=split(split(split($http.responsebody,"</th></tr>")[1],"<td align=right><b>")[1],"</b>")[0]

$value
get $_
Exit 0

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#99583 - 2003-03-17 06:12 PM Re: Weather Report
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Les: I think we'd make a good team. I explained the basics of how to do it, you supply the example code. [Big Grin]
_________________________
There are two types of vessels, submarines and targets.

Top
#99584 - 2003-03-17 06:26 PM Re: Weather Report
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, this team member would let you down. [Frown]

Jooel would have to be the designated hitter.

I tested the above code with the URL to oap.weather.com that Rad supplied and it doesn't work. Time to call in the DH.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#99585 - 2003-03-17 06:33 PM Re: Weather Report
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol [Big Grin]

sure, if you see the whole page is nothing more but an image!
_________________________
!

download KiXnet

Top
#99586 - 2003-03-17 06:38 PM Re: Weather Report
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you could try weather.com:
code:
$http=createobject("microsoft.xmlhttp")
$http.open("GET","http://www.weather.com/outlook/travel/local/FIXX0025?lswe=jyväskylä&lswa=WeatherLocalUndeclared",not 1)
$http.send
$value=split(split($http.responsebody,"<B CLASS=obsTextA>")[1],"</B>")[0]

$value
get $

pretty simple code is sufficient [Big Grin]
_________________________
!

download KiXnet

Top
#99587 - 2003-03-17 07:08 PM Re: Weather Report
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, talked to les and...
if you want to get that exact image (not text), it would be simple.
just get FTPget() UDF

and then the code you need to make is just:
code:
ftpget("http://oap.weather.com/fcgi-bin/oap/generate_magnet?loc_id=33569","%temp%\newimage.jpg")

_________________________
!

download KiXnet

Top
#99588 - 2003-03-17 07:24 PM Re: Weather Report
Incognito Offline
Getting the hang of it

Registered: 2001-07-09
Posts: 66
Mna, you guys are amazing.. This project has been a great lesson for me.

Thanks for all of your assistance - I will let you know how it works out.

Top
Page 1 of 2 12>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.088 seconds in which 0.041 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org