Alternative ATOM Feed Alert Program

Great!

Glad it’s working…

Great script! Thanks. I’m a little confused after reading the docs as what I have to do to get the the warning box part to work so that it has the icon next to it. I know I need to include AtomsFeed.php but I’m not sure of where I need to place some other code (tags). Can someone provide me the exact code I need and where it needs to be placed and in what file.

Thanks,

John

In your index.php, place this at the top just under your

<?php print $alert_box; ?>

Be sure you have called the AtomArray.php file too

Michael

Okay got the short term forecast to show. The warning box is not showing around. How do I get this to show and text centered?

Thanks,

John

This is controlled by your css file.

If you have $use_CLcss set to “true”, then the “advisoryBox” is used in your CSS file. I see that yours is commented out by the //. I would check there first for the formatting and uncomment.

John,

Your CSS file doesn’t have “advisoryBox” and that is what the script uses. There are two alternatives.
Find this

    $alert_bocks = '<div class="advisoryBox">' .  $alert_bocks . '</div>';

and change “advisoryBox” to “advisorybox” or “advisorybox1” or “advisoryBox2”

or you can use a defaulted box if you change $use_CLcss = true; to false.

John,

Looks great! http://www.harpersferry-weather.com/AtomSummary.php

Michael

FOr some of us its just a bit more time consuming figuring it all out. I’ve placed everything on my server. Nothing is working.

Chris,

I see that you’ve got something going…http://www.cwksr.com/AtomSummary.php

Let me know what you need/want to do. I’d be glad to assist you

Michael

Pretty common issue …

It might be a good idea if the script used a general data area and used that to create files in. that way you can keep it at 0777 and not have to deal with it,

You can add a simple index.php file in that directory to keep out snoopers like:

<?php
   header ("Location: /index.php");
?>

Just a quick question…

How often does it check for updates? I can force the update by going to Atomfeed.php. Its been little over 3 hours since last update. Thanks.

You could run the Atomfeed from a crontab and set for how often you want it to check for updates. Say every 15 minutes.

AtomFeed.php needs to be called by a cron job every 15 minutes or so.

Some hosters don’t offer crons but Mike Challis has a program that uses the Window$ Task Scheduler to perform this action reliably.
http://www.642weather.com/weather/wxblog/php-scripts/scheduled-http-request-windows-task-scheduler/

Got It working…TY

Fixed a minor error in the AtomSummary.php that didn’t validate as strict.

Find this

<a href="#" style="color: black; font-size: 90%;" onClick="window.open('./images/iconkey.png', '','width=572,height=398')">Icon key</a>


Replace it with this

<a href="#" style="color: black; font-size: 90%;" onclick="window.open('./images/iconkey.png', '','width=572,height=398')">Icon key</a>


If you want the timezone displayed on the end of the time at “Last update:”
Find this

  $update_time = "&nbsp;Last update: " . date ("F d Y g:i a",filemtime($file))."&nbsp;";

Replace it with this

  $update_time = "&nbsp;Last update: " . date ("F d Y g:i a T",filemtime($file))."&nbsp;";

Curly,

Added the timezone, my update time now displays:

From This:
Last Updated: July 18 2009 8:29 pm

To This:
Last Updated: July 18 2009 8:29 pm EDT

Thanks,
Michael

I’ve noticed something a little strange this morning with my AtomSummary page. I’ve added some zones outside of my area to test out the scripts. I have attached a screen shot of when there was two advisories/warnings for one zone (in this case Texas Oklahoma). Notice that there is a blue line at the top of each warning/advisory except the top one. Also, more important is a blue line through the short term forecast for Texas Oklahoma. Any ideas on where the problem is?

http://www.harpersferry-weather.com/AtomSummary.php

Thanks,

John


AtomSummary.zip (108 KB)

John,

I believe the blue lines are just the underlining indicating that they are links. It sure does mess things up when you have two in the same area. You can modify the css to remove that with text-decoration:none; I believe.

  • Jim

John,

I think the line height is spacing everything farther than what it should be. Before you adjust your CSS, do this first.
Open AtomSummary.php and find this line

print '<span style="font-size: 120%; line-height: 2em"><b>'.$a[0][2].' - '. $a[0][0]. '</b></span>
';

Replace it with this line

print '<span style="font-size: 120%"><b>'.$a[0][2].' - '. $a[0][0]. '</b></span>
';

After you do that, then the css can be adjusted if needed.

That doesn’t seem to have done anything. Where do you suggest that I make adjustments to the decoration?

Thanks,

John