diff --git a/1stPara.php b/1stPara.php index 3872094..d78a24b 100755 --- a/1stPara.php +++ b/1stPara.php @@ -9,6 +9,13 @@ if (!isset($argv[1])) $url = $argv[1]; $data = shell_exec("curl -s $url"); preg_match("/\
(.*)\<\/p\>/", $data, $match); + +if (!isset($match[1])) +{ + print "No Wikipedia article found at that URL\n"; + exit(1); +} + $string = strip_tags($match[1]); print (wordwrap($string, 60, "\n") . "\n");