Welcome, Guest. Please login or register.
Did you miss your activation email?
February 10, 2012, 06:24:29 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149516 Posts in 21086 Topics by 7530 Members
Latest Member: dwaynebryant
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Weather Module  (Read 7392 times)
neamathla

Offline Offline

Posts: 1


« on: October 16, 2007, 04:56:03 PM »

Here is simple weather module.  It displays the current conditions for given location.  The weather data is drawn from weather.com's xml feed.  So you will need to get a partner id and member key from them.  Registration is required, but it is free.  The registration link is http://www.weather.com/services/xmloap.html.  The display layout is customizable.  The code is a little clunky, but maybe someone will find it useful.
Logged
sharmpro

Offline Offline

Posts: 64



WWW
« Reply #1 on: June 13, 2008, 10:21:30 AM »

Hi,
i implemented your module into my site and i found the needs a little update...

into MEMBER_KEY field needs to specify: YOUR_MEMBER_KEY&link=xoap&cc=*

and everything works again..


Best regards, 

Stefano
Logged

erpe

Offline Offline

Posts: 2077


WWW
« Reply #2 on: September 17, 2008, 01:33:07 PM »

Hi SharmPro

can you please post, where to modify?
I don't understand your post above.

Thanks

erpe
Logged

sharmpro

Offline Offline

Posts: 64



WWW
« Reply #3 on: September 17, 2008, 07:01:02 PM »

Hi,
in the backend Settings of the page..

Weather Codes
Partner ID:     ___________________ _
Member Key:     ___________________ _
Location ID:     ___________________ _
Display Layout:   ___________________ __
                   
                   

you can define your module.

Regards,
Stefano
Logged

erpe

Offline Offline

Posts: 2077


WWW
« Reply #4 on: September 17, 2008, 07:21:48 PM »

Hi Sharmpro

yes, I see.
But I cannot find a location ID in the subscribing mails.
I got only Partner ID and member key.
I tried it with the code of London from the readme file in the zip, but it failed.

Who can help?

rgds

erpe
Logged

Hans>NULL

Offline Offline

Posts: 1389


« Reply #5 on: September 17, 2008, 11:25:34 PM »

@erpe
Wie "sharmpro" schon sagte, aber hier noch einmal etwas klarer (hoffe ich)

Member Key: 123456789&link=xoap&cc=
bzw.
Member Key: 123456789&link=xoap&cc=*&dayf=5&unit=s
oder
Member Key: 123456789&link=xoap&cc=*&dayf=10&unit=s

eintragen, nicht nur den key solo

und im html z.b. auch zusätze:

<h2>[LOCATION_AREA]</h2>
<h3>[LONGITUDE] [LATITUDE]</h3>
<h3>[WIND_SPEED_KPH] [WIND_DIRECTION] </h3>
Last update: [LAST_UPDATE]<br /><br />
<table width="100%" cellpadding="0" cellspacing="0" class="box">

usw.

oder auch [ICON_LARGE] statt [ICON_MEDIUM]
« Last Edit: September 18, 2008, 01:05:29 AM by Hans>NULL » Logged

/dev/null Ort ohne Wiederkehr
erpe

Offline Offline

Posts: 2077


WWW
« Reply #6 on: September 18, 2008, 10:15:42 AM »

Hi Hans

dann bin ich wohl zu doof.

Habe mit meiner Anmeldung in einer mail bekommen:

Your weather.com XML Partner ID & License Key:
Partner ID: 123456789
License Key: blab123bla456  (=Member-Key?)

und das war es. Keine Spur von Location ID
Dann habe ich die Location ID von London aus der readme Datei genommen und entsprechend eingesetzt.
Ergebnis: No Weatherdata available

Was mache ich denn falsch? Seh ich den Wald vor lauter Bäumen nicht?

Gruss

erpe

Logged

Hans>NULL

Offline Offline

Posts: 1389


« Reply #7 on: September 19, 2008, 12:48:03 AM »

 <Off-Topic>
Ich komm mal per PM
 </Off-Topic>
Logged

/dev/null Ort ohne Wiederkehr
erpe

Offline Offline

Posts: 2077


WWW
« Reply #8 on: September 19, 2008, 07:19:10 AM »

@all
I found out, what was wrong:

Server must allow fopen.
Please see your phpinfo if fopen is on.
I tested it on another server and it is doing well,
(though registration at weather.com is a little bit annoying).

rgds

erpe
Logged

crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #9 on: February 09, 2010, 04:36:35 PM »

Hi,

I tried this module on WB portable server, fopen is allowed but it want work..

I know this is an old module,but could someone take a look at this code:

Code:
       $forecast_url = 'http://xoap.weather.com/weather/local/'.$location_id.'?cc=*&prod=xoap&par='.$partner_id.'&key='.$member_key;
        $urldata = parse_url($forecast_url);
        $filepointer = @fsockopen($urldata['host'], 80, $errno, $errstr, 1);

        if (!$filepointer) {
            echo '<h2>Weather Data Unavailable</h2>';
        } else {
            $data = implode('', file($forecast_url));


I am getting an error: Warning: file(http://xoap.weather.com/weather/local/MWXX0001?cc=*&prod=xoap&par=1165359557&key=117b16b47b0919df) [function.file]: failed to open stream: HTTP request failed! in G:\WebsiteBaker Portable1_2\htdocs\dekar\modules\weathercom\view.php on line 55

Line 55 is the last line..

Or is there some other work around to extract data from this link
« Last Edit: February 09, 2010, 04:42:43 PM by crnogorac081 » Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Luckyluke

Offline Offline

Posts: 555



« Reply #10 on: February 09, 2010, 06:02:15 PM »

Hi,

A little offtopic but for the weather there is a new tool ==> http://www.ebrueggeman.com/phpweatherlib/
I didn't use or study it. Maybe somebody can make a droplet of it?  rolleyes

Grtz,
Luc
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!