Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    5
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    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:
    Celcius for Simple MSN Weather
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • Users who have thanked StupidRalph for this post:

    ngohuynhnguyen (08-24-2007)

  • #3
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    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.

  • Users who have thanked mlseim for this post:

    ngohuynhnguyen (08-24-2007)

  • #4
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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!

  • #5
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    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 Attached Files

  • Users who have thanked mlseim for this post:

    ngohuynhnguyen (08-24-2007)

  • #6
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    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"

    ?>

  • Users who have thanked mlseim for this post:

    ngohuynhnguyen (08-24-2007)

  • #7
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    4
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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!

  • #8
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,389
    Thanks
    8
    Thanked 1,077 Times in 1,068 Posts
    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.

  • Users who have thanked mlseim for this post:

    ngohuynhnguyen (08-24-2007)

  • #9
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •