Skip to content

Instantly share code, notes, and snippets.

Created June 13, 2014 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/09c72cf93fe162d50f40 to your computer and use it in GitHub Desktop.
Save anonymous/09c72cf93fe162d50f40 to your computer and use it in GitHub Desktop.
A simple script to determine which commandline web slurping tool you can use from cron
<?php
$utils = array ('/usr/local/bin/w3m', '/usr/bin/w3m', '/usr/local/bin/curl', '/usr/bin/curl', '/usr/local/bin/GET', '/usr/bin/GET', '/usr/local/bin/lynx', '/usr/bin/lynx',
'/usr/local/bin/links', '/usr/bin/links', '/usr/local/bin/wget', '/usr/bin/wget');
$i = 0;
foreach ($utils as $util)
{
$hit = is_executable ($util);
if ($hit)
{
$works[$i] = $util;
$i++;
}
}
echo "You can use any of the following in your crontab:<br>";
foreach ($works as $choice)
{
echo $choice . "<br>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment