Created
June 13, 2014 01:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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