-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A. Khattri wrote:
>On Tue, 20 Sep 2005, Ow Mun Heng wrote:
>
>>Remember my script that sends out HTML emails? Well, that's done, but
>>it's in-efficient.
>>
>>The actual script that parses screen-scrapes. Initial script only went
>>to get the "Last Price" now, I would like to add the "Day Range"
>>
>>last_price()
>>{
>>value="$(lynx -dump "$url$symbol" | grep 'Last price:' | \
>> awk -F: 'NF > 1 && $(NF) != "N/A" { print $(NF) }' )"
>>}
>>
>>day_range()
>>{
>>day_range="$(lynx -dump "$url$symbol" | grep 'Low \& High:' | \
>> awk -F: 'NF > 1 && $(NF) != "N/A" { print $(NF) }' )"
>>}
>>
>>The above is in-efficient because I need to call the script to get the
>>page 2 times.
>
>
>Err... what were you saying about perl being hard...?
>
>(At some point, your shell script will become so convoluted that perl
>or python will look easy ;-)
>
>
Very true. I'm not familiar with python (although, I'd like to pick
it up), but perl is /perfect/ for screen scraping and text parsing.
- --
gentux
echo "hfouvyAdpy/ofu" | perl -pe 's/(.)/chr(ord($1)-1)/ge'
gentux's gpg fingerprint ==> 34CE 2E97 40C7 EF6E EC40 9795 2D81 924A
6996 0993
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDMEoQLYGSSmmWCZMRAjBKAJ41tzDIkLvHL6z0EHtLSstdNaQWswCgxV0P
P7K37q6Exf0oMjLlI/Unng8=
=1cXq
-----END PGP SIGNATURE-----
--
[email protected] mailing list