I'm trying to grab the image located here and save it in my server few times per day, just as if I "right-click" on the image and save it on my desktop. I have decided to use perl script to do this, here's what I wrote so far:
use Image::Grab;
$pic->regexp('.*\.png');
$pic->search_url('http://www.reuters.wallst.com/enhancements/chartapi/index_chart_api.asp?symbol=.SPX&headerType=quote&width=316&height=106&duration=3');
$pic->grab;
open(IMAGE, ">index_chart_api.png") || die"index_chart_api.png: $!";
binmode IMAGE; # for MSDOS derivations.
print IMAGE $pic->image;
close IMAGE;
After running it via ssh I receive this error: Can't call method "regexp" on an undefined value at line 2
Anyone has any idea what is wrong with this line "$pic->regexp('.*.png');" or how to grab and save this image (index_chart_api.png) from mentioned url on ones server properly ?
Appreciate any help with this.
Note that the URL gave shows the PNG image in my browser meaning there is no HTML to search for the image. In principle, then, the following script ought to work:
I used a similar script to produce Norwegian Sun in the Baltic Sea - 6 days in 5 minutes.