I am making a weather page and I would need to screen scape the radar image on http://www.weather.bm/radarMobile.asp just the radar images. Fatherstorm has help me before and given me a php script it worked but with some bugs.
$localOffset = "+2 Hours"; //change this to your local offset from the image times you need. for me (CST) it's 2 hours.....
$start= strtotime("-90 Minutes " . $localOffset); // go back 90 minutes (The limit of the available images)
$start=($start-($start % (600))+(60*6)); //go to the next earlier 6 minute mark (all images appear to be at the 6 minute mark))appear to be at the 6 minute mark))
for($x=1;$x<=9;$x++){
$DateTime = date("Y-m-d-Hi", $start); // set the image time we want.
$fName = ("http://www.weather.bm/images/Radar/CurrentRadarAnimation_100km_sri/100km_sri-radar- $DateTime.jpg"); // set the filename
echo" $min <img src='$fName' alt='$fName'/><br/>"; // echo (or add to a stack or variable...) your image node
$start+=(600);//add 10 minutes }
Here are the problems: most of the time some images and discription is not showing due to different time. the script has 10 images but some times the site only displays 9 or 8.
I need a script that could scrape the images put it in a div ul li so I can animate it like in the original site(I mean the slideshow effect) or make it's path absolute don't know how it would help but I sure want to know how to do that also. The weather sites images is in a javascript array which I am not familliar.
I need the whole script so I can study it before using it so I can learn in the process.
I may be annoying to some cause I might have written this problem before, please bare with me as I am trying to do my best to study this stuff but I need the script ASAP. Thank you for your help
I've already given you a working answer. You are unable to use it because you seemingly don't comprehend how PHP works. If so, you should consider paying a freelancer to do your coding and script setup. Stackoverflow is not a for-free coding forum - and people are much less inclined to help if people don't even bother to upvote or accept answers.
I personally think its NOT OK to screen scrape. It may be OK to use API if they have one, but if they don't provide API Or XML feed for what you need, then you may be violating some copyrights by copying their images, even if it's a radar map.
Proceed at your own risk but remember that it's possible that they will find out and take legal actions.