Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-23-2007, 07:13 PM   PM User | #1
ngohuynhnguyen
New to the CF scene

 
Join Date: Aug 2007
Posts: 4
Thanks: 5
Thanked 0 Times in 0 Posts
ngohuynhnguyen is an unknown quantity at this point
Smile Weather module for my website!

Hello!
I'm Huynh Nguyen. I'm very interested in http://www.oliverhine.com/ weather module, but unfortunately it's just for the Dot Net Nuke system and further more for ASP (IIS server) technology. However I'm now using PHP in an apache server to run my website. So could you help me with this problem? I love http://www.oliverhine.com/ weather module so much I really want to get it in to my PHP website. Please help me to convert it or something like that.
Waiting for your reply in hopefully!
Best Regards,
Huynh Nguyen
ngohuynhnguyen is offline   Reply With Quote
Old 08-23-2007, 07:36 PM   PM User | #2
StupidRalph
Senior Coder

 
Join Date: Mar 2003
Location: Atlanta
Posts: 1,037
Thanks: 14
Thanked 30 Times in 28 Posts
StupidRalph is on a distinguished road
You should try a search on this forum b/c there are a few threads out there which cover this topic. I know of one specifically:
http://www.codingforums.com/showthread.php?t=79468
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
StupidRalph is offline   Reply With Quote
Users who have thanked StupidRalph for this post:
ngohuynhnguyen (08-24-2007)
Old 08-23-2007, 07:57 PM   PM User | #3
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
What is your city ... I'll check it and see if the deal I have works good.

And you want to create your very own customized feed or use this?
http://www.weather.com/services/oap....efer=rss_index

Last edited by mlseim; 08-23-2007 at 08:24 PM..
mlseim is offline   Reply With Quote
Users who have thanked mlseim for this post:
ngohuynhnguyen (08-24-2007)
Old 08-24-2007, 02:26 AM   PM User | #4
ngohuynhnguyen
New to the CF scene

 
Join Date: Aug 2007
Posts: 4
Thanks: 5
Thanked 0 Times in 0 Posts
ngohuynhnguyen is an unknown quantity at this point
Well, I've try to do some searching. However what I've shown on the demo URL is different from all. I also know that this module get the data from the website weather.com. There's a simple way available on that website (weather.com) to let using add the weather bug in their website, however, with the source (script) given by weather.com, there a lot of thing do not necessary, such as ads, weather.com logo, etc..
As you can see from the demo URL I've just given above, the weather bug box just inclue the images, some information. Yes, it's really nice and of course, do not have any ads at all. That's all I need.

My city is Ho Chi Minh City, Viet Nam

Again, someone could help me please, thank you so much!
ngohuynhnguyen is offline   Reply With Quote
Old 08-24-2007, 01:19 PM   PM User | #5
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Now you have to decide how much info you want to have ...

In this example (using weather underground), it grabs the
basics for current weather and a couple of more days forecast.

You can parse-out anything you need (customize the data).
Using a split on pipes | , you can parse out the details for
the current weather, then display them anyway you want.

Here's my basic working example:
http://www.catpin.com/vietnam

Here is the PHP script:
PHP Code:
<?php
 
echo"
<style>
#rss{
margin: 0px auto;
font-family: arial;
font-size: 8pt;
color: #222;
width: 200px;
padding: 5px 10px 5px 0px;
border: 1px solid #555;
text-align: left;
}
</style>
"
;
include 
"./lastRSS.php"
$rss = new lastRSS
$count=1;
if (
$rs $rss->get('http://www.wunderground.com/auto/rss_full/global/stations/48900.xml?units=both')) { 
echo 
"<div id='rss'><ul>\n"
foreach(
$rs['items'] as $item) {
if(
$count<=5){
list (
$ione$itwo$ithree) = split ('-'$item['title']);
list (
$one$two$three) = split ('-'$item['description']);
echo 
"$ione<br>$one <br>$itwo<br> $two <br> $three <br> "
}
$count=$count+1;

echo 
"</ul></div>\n"

else { 
echo 
"Error: It's not possible to reach RSS file...\n"

?>
And attached is the required file: lastRSS.php

I attached as a .txt file ... change the extension to .php
Attached Files
File Type: txt lastRSS.txt (8.8 KB, 93 views)
mlseim is offline   Reply With Quote
Users who have thanked mlseim for this post:
ngohuynhnguyen (08-24-2007)
Old 08-24-2007, 03:09 PM   PM User | #6
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Here's an example of what I mean by parsing out the current details and
using some graphic images to determine what the conditions are. You of
course might have some different condition graphics you'll need.

My working "live" example:
http://www.catpin.com/weather/vietnam.php

Here's the PHP script for that:
PHP Code:
<?php
 
echo"
<style>
#rss{
margin: 0px auto;
font-family: arial;
font-size: 8pt;
color: #222;
width: 225px;
height: 60px;
padding: 0px 0px 0px 0px;
border: 1px solid #555;
text-align: left;
}
</style>
"
;
include 
"./lastRSS.php"
$rss = new lastRSS
$count=1;
if (
$rs $rss->get('http://www.wunderground.com/auto/rss_full/global/stations/48900.xml?units=both')) {
$city="Ho Chi Minh City";
echo 
"<div id='rss'>\n"
foreach(
$rs['items'] as $item) {
if(
$count<=1){
list (
$one$two$three) = split ('-'$item['description']);
list (
$temp$humidity$test$conditions) = split ('\|'$one);
$con="pixel.gif";
if(
strstr($conditions'vercast')){$con="overcast.gif";}
if(
strstr($conditions'ain')){$con="rain.gif";}
if(
strstr($conditions'og')){$con="fog.gif";}
if(
strstr($conditions'now')){$con="snow.gif";}
if(
strstr($conditions'loudy')){$con="cloudy.gif";}
if(
strstr($conditions'unny')){$con="sunny.gif";}
if(
strstr($conditions'lear')){$con="sunny.gif";}
if((
strstr($conditions'unny'))&&(strstr($conditions'artly'))){$con="partly.sunny.gif";}
if((
strstr($conditions'loudy'))&&(strstr($conditions'artly'))){$con="partly.cloudy.gif";}
if((
strstr($conditions'loudy'))&&(strstr($conditions'ostly'))){$con="mostly.cloudy.gif";}
if((
strstr($conditions'louds'))&&(strstr($conditions'catter'))){$con="partly.cloudy.gif";}
echo 
"
<img src='$con' width='50' height='40' alt='$con' title='$con' border='0' style='float: left; padding: 0px 5px 0px 0px;' />
<b>$city</b><br>$temp<br>$humidity<br>&nbsp;&nbsp;$conditions
"
;

}
$count=$count+1;

echo 
"</div>\n"

else { 
echo 
"Error: It's not possible to reach RSS file...\n"

?>
mlseim is offline   Reply With Quote
Users who have thanked mlseim for this post:
ngohuynhnguyen (08-24-2007)
Old 08-24-2007, 03:53 PM   PM User | #7
ngohuynhnguyen
New to the CF scene

 
Join Date: Aug 2007
Posts: 4
Thanks: 5
Thanked 0 Times in 0 Posts
ngohuynhnguyen is an unknown quantity at this point
wow, I cannot say how much thank you I have to say with you, thank you so much. And just more last more things, can I change the language using in your demo, such as Vietnamese. If yes, it perfect!
ngohuynhnguyen is offline   Reply With Quote
Old 08-24-2007, 04:14 PM   PM User | #8
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,055
Thanks: 8
Thanked 1,032 Times in 1,023 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
You have the script right there ... do whatever you want with it.

Also make sure you get "lastRSS.txt" file (see attached file in previous post),
then change extension to .php

I assume you have some character set that is Vietnamese instead of English?
I'm not sure how that works, but the characters are a function of the
content type ... nothing to really do with the script itself.

You would have to convert the English words that come from the XML
from English to Vietnamese ... that part I'm not sure how to do.
mlseim is offline   Reply With Quote
Users who have thanked mlseim for this post:
ngohuynhnguyen (08-24-2007)
Old 07-05-2011, 11:30 AM   PM User | #9
jmemac
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jmemac is an unknown quantity at this point
help with the weather

Hello i have some questions id like to ask about developing my website but am unsure where to post them, i know you have specific forums for things such as java script ect but what if your unsure what forum to post in could you not have a forum for such questions where the person requiring knoledge can post questions?.

for explanation the questions i have regard a weather module for my site, i have surched this on your site and many others but cannot find a modle detailed enough, user friendly enough or accurate enough for my requirements.

i require a modle that is graphically pleasing animated and can collect data from various sources mainly weather bouys to show sea swell, wave power also i need wind speed and direction and water temp.

something such as the animated charts on www.magicseaweed.com would be amazing.

i have been searching to try and source such a thing for a few months now and am getting no where. so if you could help me post this request in the correct place and even help me find the answer i would be eternally gratefull.
jmemac is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:05 AM.


Advertisement
Log in to turn off these ads.