Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dutchnewbie

macrumors regular
Original poster
Apr 22, 2012
151
0
The Hague - The Netherlands
Hi,

I see that some geeklets require lynx but what is that and is it standard installed?

for example here is a code i found
Code:
lynx -dump http://printer.wunderground.com/cgi-bin/findweather/hdfForecast?query=17552|awk '/Temp/{printf $2, ": "; for (i=3; i<=3; i++) printf $i " " }'
lynx -dump http://printer.wunderground.com/cgi-bin/findweather/hdfForecast?query=17552|awk '/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i " " }'
 
Almost. It's being used, with awk, to obtain and extract the data. awk is a command line program and a programming language used for working with text. The -dump flag tells lynx to output the webpage to what's called it's standard output. the " | " connects this to the awk standard input.

wunderground is having an internal server error at the moment, but in the 2nd case awk will print out the 2nd through 10th field on lines that contain "Cond" but not "Fore":

Code:
> echo "Cond Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve" |awk '/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i " " }'
Two Three Four Five Six Seven Eight Nine Ten
>
> echo "Cond Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve Fore" |awk '/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i " " }'
>

edit: and lynx doesn't seem to be installed. look into macports or fink
 

Attachments

  • Schermafbeelding 2012-06-19 om 19.40.48.png
    Schermafbeelding 2012-06-19 om 19.40.48.png
    53.4 KB · Views: 76
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.