Re: [PHP] php + lynx + grep
Why not try cURL? Not the cURL functions included in PHP, but the actual binary installed with most linux distributions. Even better would be to actually use the cURL functions in PHP, but whatever you find easier. Matt On Tue, 2004-04-06 at 08:41, Brian L. Ollom wrote: lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. It's output should be something like this(it changes hourly): TDFONT FACE=Arial,Helvetica KTOL 061152Z 23004KT 10SM CLR 00/M07 A3007 RMK AO2 SLP187 T1072 10017 21033 53005 Help! | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] |
[PHP] php + lynx + grep
lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. It's output should be something like this(it changes hourly): TDFONT FACE=Arial,Helvetica KTOL 031452Z 28013KT 10SM CLR 10/01 A2977 RMK AO2 SLP086 T0106 58015 Help! | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php + lynx + grep
lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. It's output should be something like this(it changes hourly): TDFONT FACE=Arial,Helvetica KTOL 061152Z 23004KT 10SM CLR 00/M07 A3007 RMK AO2 SLP187 T1072 10017 21033 53005 Help! | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php + lynx + grep
lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. It's output should be something like this(it changes hourly): TDFONT FACE=Arial,Helvetica KTOL 031452Z 28013KT 10SM CLR 10/01 A2977 RMK AO2 SLP086 T0106 58015 Help! | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | ForPilot's - Software for your piloting needs! http://www.forpilots.com/ Great Deals on Great Pilot Supplies! http://www.acespilotshop.com/cgi-bin/ares.cgi?ID=240400532 Want deals on other great stuff? Click here! http://www.dollardays.com/index.asp?affilid=385 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Brian L. Ollom wrote: lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. It's output should be something like this(it changes hourly): TDFONT FACE=Arial,Helvetica KTOL 061152Z 23004KT 10SM CLR 00/M07 A3007 RMK AO2 SLP187 T1072 10017 21033 53005 Help! | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | Try $output = `lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1` Those are backticks, not single quotes surrounding the command. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Brian L. Ollom wrote: lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. You know, it might be easier if you use the new NOAA XML weather feeds [ http://www.nws.noaa.gov/alerts/ ]. Also, did you know that you can FTP into their public server and download observation reports? They are cycled every hour, and are available via anonymous FTP from weather.noaa.gov/data/observations/metar/cycles directory. Or, you can use snoopy and submit your ICAO code to http://www.noaa.gov/weather/metar.shtml and have snoopy return the plain text version of the file. You should get your METAR report there. (yes, I am an avid flight simulator) Sorry I didn't answer your original question. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Functions like system, exec etc aren't supported by most ISP ( at least over here in germany ). But you might give file_get_contents(); file(); ... a look as they can read the output of HTTP request which might be easier: $var = file ( 'http://weather.noaa.gov/weather/current/KTOL.html' ); foreach ( $var AS $line ) { if ( preg_match( 41-35-19N , $var ) ) ... etc pp } good luck, red [...] lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1 I need to get the output of the above command for a web site I'm working on. I've tried exec(), system() and neither seems to work. It's output should be something like this(it changes hourly): TDFONT FACE=Arial,Helvetica KTOL 031452Z 28013KT 10SM CLR 10/01 A2977 RMK AO2 SLP086 T0106 58015 [...] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Try $output = `lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1` Those are backticks, not single quotes surrounding the command. Backticks didn't work either. I got it to work by using a cron to the info into a text file and then include()'d the text file in the website, but I'd rather not have to rely on the cron job if I don't have to. | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Functions like system, exec etc aren't supported by most ISP ( at least over here in germany ). But you might give file_get_contents(); file(); ... a look as they can read the output of HTTP request which might be easier: $var = file ( 'http://weather.noaa.gov/weather/current/KTOL.html' ); foreach ( $var AS $line ) { if ( preg_match( 41-35-19N , $var ) ) ... etc pp } I am the ISP, but I'll try that and see if it helps... (o; | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Brian L. Ollom wrote: Try $output = `lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1` Those are backticks, not single quotes surrounding the command. Backticks didn't work either. I got it to work by using a cron to the info into a text file and then include()'d the text file in the website, but I'd rather not have to rely on the cron job if I don't have to. | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | What's the output you're looking for. When I run that line of code, and echo out $output, I get... TDFONT FACE=Arial,Helvetica KTOL 061552Z 22013KT 10SM CLR 11/M03 A3001 RMK AO2 SLP164 T0033 -- *** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \/ /__ _ _| |__ ___ __ ___ _ __ * 716.856.9675 * * | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ ' \ * 737 Main St. * * |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150 * * |___/ * Buffalo, NY * * http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
Brian L. Ollom wrote: What's the output you're looking for. When I run that line of code, and echo out $output, I get... TDFONT FACE=Arial,Helvetica KTOL 061552Z 22013KT 10SM CLR 11/M03 A3001 RMK AO2 SLP164 T0033 On a website or command line? Command line is the easy part, but I'm having problems getting that to work on a web site. | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | ForPilot's - Software for your piloting needs! http://www.forpilots.com/ Great Deals on Great Pilot Supplies! http://www.acespilotshop.com/cgi-bin/ares.cgi?ID=240400532 Want deals on other great stuff? Click here! http://www.dollardays.com/index.asp?affilid=385 This is the exact code I used, and hit via a browser ?php $output = `lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1`; echo ( $output ); ? -- *** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \/ /__ _ _| |__ ___ __ ___ _ __ * 716.856.9675 * * | ' / -_) _` \ \/\/ / _ \ '_| / /(_-_/ _/ _ \ ' \ * 737 Main St. * * |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150 * * |___/ * Buffalo, NY * * http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + lynx + grep
On Apr 6, 2004, at 12:53 PM, Brian L. Ollom wrote: Try $output = `lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v '41-35-19N' |grep TOL | head -n 1` Those are backticks, not single quotes surrounding the command. I use following to retrieve output with Lynx: $out = `lynx -dump -source http://localhost`; Backticks didn't work either. I got it to work by using a cron to the info into a text file and then include()'d the text file in the website, but I'd rather not have to rely on the cron job if I don't have to. | Brian Ollom | | | NiteHawke.Com| http://www.nitehawke.com/| | An Authorized Firefly Dealer | email [EMAIL PROTECTED] | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php