| #!/usr/bin/php |
| <?php |
| /* |
| * run_autoremind.php created on 31/01/2006 |
| * |
| * @author Eduardo A. Romero Gomez |
| */ |
| |
| function system_o($cmd) |
| { |
| exec("$cmd", $f); |
| foreach($f as $output) { |
| $output = htmlentities($output); |
| $ret .= "$output\n"; |
| } |
| return $ret; |
| } |
| |
| $host = php_uname('n'); |
| $host = strtolower($host); |
| $url = "http://eclipse.org/projects/auto_reminder.php"; |
| if(!(FALSE === strstr($host, "ditto")) || !(FALSE === strstr($host, "vlissides")) || !(FALSE === strstr($host, "mparra"))) |
| { |
| // It's one of ours, no need to hug eclipse.org resources |
| $url = "http://phoenix.baueralonso.com/projects/auto_reminder.php"; |
| } |
| echo $url; |
| $html = @file($url); |
| // check if we could fetch anything |
| if(strlen($html) <= 0) |
| { |
| // let's try wget instead |
| $cmd = "wget $url"; |
| $html = system_o($cmd); |
| } |
| ?> |