Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell Script in GeekTool trouble ...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Dysfunction" data-source="post: 940875" data-attributes="member: 51052"><p>Ok, so.. I redid that whole thing piping things to files (which eliminated the transmission details)... </p><p></p><p></p><p>[code]</p><p>mikeMbp:~ mike$ cat wundweather.tst |sed -n '21p' |sed -e 's/<span class="nowrap"><b>//g' |sed -e 's/<\/b.*//g' </p><p> 14</p><p>mikeMbp:~ mike$ cat hobartweather.tst |sed -n '21p' |sed -e 's/<span class="nowrap"><b>//g' |sed -e 's/<\/b.*//g' </p><p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></p><p>mikeMbp:~ mike$ [/code]</p><p></p><p>so.. this should work...</p><p></p><p>[code]</p><p>curl http://www.eldersweather.com.au/tas/lower-derwent/hobart?fc=9329 |sed -n '448p' |sed -e 's/<td class="center bold">//g' |sed -e 's/&.*//g' </p><p>[/code]</p><p>[code]</p><p>mikeMbp:~ mike$ cat hobartweather.tst |sed -n '448p' |sed -e 's/<td class="center bold">//g' |sed -e 's/&.*//g' </p><p> 14.5</p><p>mikeMbp:~ mike$ </p><p></p><p>[/code]</p><p></p><p>edit.. how did I find the line number?</p><p>[code]</p><p>mikeMbp:~ mike$ cat -n hobartweather.tst |grep 14.5</p><p> 448 <td class="center bold">14.5°C</td>[/code]</p></blockquote><p></p>
[QUOTE="Dysfunction, post: 940875, member: 51052"] Ok, so.. I redid that whole thing piping things to files (which eliminated the transmission details)... [code] mikeMbp:~ mike$ cat wundweather.tst |sed -n '21p' |sed -e 's/<span class="nowrap"><b>//g' |sed -e 's/<\/b.*//g' 14 mikeMbp:~ mike$ cat hobartweather.tst |sed -n '21p' |sed -e 's/<span class="nowrap"><b>//g' |sed -e 's/<\/b.*//g' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> mikeMbp:~ mike$ [/code] so.. this should work... [code] curl http://www.eldersweather.com.au/tas/lower-derwent/hobart?fc=9329 |sed -n '448p' |sed -e 's/<td class="center bold">//g' |sed -e 's/&.*//g' [/code] [code] mikeMbp:~ mike$ cat hobartweather.tst |sed -n '448p' |sed -e 's/<td class="center bold">//g' |sed -e 's/&.*//g' 14.5 mikeMbp:~ mike$ [/code] edit.. how did I find the line number? [code] mikeMbp:~ mike$ cat -n hobartweather.tst |grep 14.5 448 <td class="center bold">14.5°C</td>[/code] [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell Script in GeekTool trouble ...
Top