1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Satellite 1.1

Shows a satellite image in forum sidebar.

  1. AndyB

    AndyB Well-Known Member

    Creating a satellite image with a Cron Job:

    I suggest creating a Cron job on your server so the image will load faster. Also many satellite images are very large and you might need to crop the image. All this can be done using the example PHP as shown here:


    // define satelliteUrl
    $satelliteUrl 'http://goes.gsfc.nasa.gov/goescolor/goeswest/pacific2/color_lrg/latest.jpg';

    // define satellitePath
    $satellitePath '/home/southbay/www/misc/satellite.jpg';

    // define latestTextPath
    $latestTextPath '/home/southbay/www/weather/california/images/latest.txt';

    // get timestamp
    $timestamp file_get_contents($latestTextPath);

    // get data
    $data file_get_contents($satelliteUrl);

    // save satellite.jpg, this file will be modified

    // reduce image size from 3600x3000
    exec("/usr/bin/convert -quiet $satellitePath -crop 900x625+750+450 $satellitePath");

    // convert date format    
    $date date(' F d, Y g:i A '$timestamp);

    // add date to image
    exec("/usr/bin/convert $satellitePath -font courier_new.ttf -pointsize 12 -fill black -undercolor white \
    -gravity northwest -annotate +2+2 '
    Last edited: Nov 15, 2014
  2. AndyB

    AndyB Well-Known Member

Share This Page