// This program copyright 2004 Mark Summerlin http://www.fish-tails.net
// This program may not be distributed without owners written permission.
// No warranties implied. Use of this script is at your own risk
/*
////////// DIRECTIONS ///////////////////
AS ALLWAYS, BACKUP YOUR DATABASE BEFORE RUNNING THIS SCRIPT!
1. YOU MUST FIRST CREATE THE TABLE WHICH WILL HOLD THE DATA
BELOW IS THE SQL TO CREATE THE TABLE.
IF YOU USE A DIFFERENT PREFIX THAN w3t YOU WILL OF COURSE NEED TO CHANGE THAT.
YOU SHOULD BE ABLE TO JUST CUT AND PASTE THE SQL INTO PHPMYADMIN, AS THIS IS A PHPMYADMIN EXPORT TO BEGIN WITH
CREATE TABLE `w3t_tides` (
`tide_id` int(3) NOT NULL auto_increment,
`tide_station` varchar(50) NOT NULL default '',
`tide_data` text NOT NULL,
PRIMARY KEY (`tide_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
2. NOW THAT YOUR TABLE HAS BEEN CREATED, IT'S TIME TO INSERT THE DATA
YOU NEED TO HAVE YOUR URL'S READY FOR THIS.
SINCE YOU ARE IN WASHINGTON AND MOST LIKELY YOU WILL USE THOSE TIDES, HERE IS THE LINK:
http://co-ops.nos.noaa.gov/tides04/tpred2.html#OR
FIND YOUR STATION AND COPY THE LINK YOU WANT INTO THE $URL VARIABLE
YOU WILL NEED TO TYPE IN THE NAME OF THE LOCATION INTO THE $STN VARIABLE
EXAMPLE
$url = "http://co-ops.nos.noaa.gov/cgi-bin/get_pred.cgi?year=2004&stn=0030+Fernandina+Beach&secstn=St.+Marys+Entrance,+North+Jetty&thh=-0&thm=36&tlh=-0&tlm=03&hh=*0.96&hl=*0.96";
$stn = "St. Marys Entrance, North Jetty";
3. UNCOMMENT THE REST OF THE SCRIPT. DROP INTO YOUR UBBTHREADS DIRECTORY, JUST LIKE THE LINKS SCRIPT
THEN RUN THE SCRIPT. THAT'S IT.
NOTE!!!!! I HAVE THE SCRIPT SET TO ECHO THE DATA IN THE BROWSER SO YOU CAN CHECK THE NAME YOU TYPED IN AS
THE $stn TO THE ACTUAL OUTPUT. TO ADD MORE STATIONS SIMPLY CHANGE THE 2 VARIABLES AND RERUN THE SCRIPT.
IT WILL AUTO INCREMENT, AND WILL BE READY TO JUST DROP THE CALENDAR INTO PLACE AND GO! (WHEN I CLEAN IT UP OF COURSE)
/*
require ("main.inc.php");
$url = "";
$stn = "";
$lines = file($url);
$lines = implode('', $lines);
$lines = strip_tags($lines);
$lines = eregi_replace("Sat", "", $lines);
$lines = eregi_replace("Sun", "", $lines);
$lines = eregi_replace("Mon", "", $lines);
$lines = eregi_replace("Tue", "", $lines);
$lines = eregi_replace("Wed", "", $lines);
$lines = eregi_replace("Thu", "", $lines);
$lines = eregi_replace("Fri", "", $lines);
$lines = eregi_replace("LST", "", $lines);
$lines = eregi_replace("LDT", "", $lines);
$lines = eregi_replace("01/", "1/", $lines);
$lines = eregi_replace("02/", "2/", $lines);
$lines = eregi_replace("03/", "3/", $lines);
$lines = eregi_replace("04/", "4/", $lines);
$lines = eregi_replace("05/", "5/", $lines);
$lines = eregi_replace("06/", "6/", $lines);
$lines = eregi_replace("07/", "7/", $lines);
$lines = eregi_replace("08/", "8/", $lines);
$lines = eregi_replace("09/", "9/", $lines);
// insert data into database
$query = "INSERT INTO {$config['tbprefix']}tides
(tide_station, tide_data)
VALUES ('$stn', '$lines')
";
$process_data = $dbh -> do_query($query);
echo "
"; echo $lines; echo ""; */ ?>