Originally Posted by
Inodoro Pereyra
Ok, I need help.
For the last month or so, with the invaluable "help" from Sector11 (I put "help" because, in reality, he did almost everything for me, and I just moved things around a bit, and changed some colors), I got to a point where my desktops are finally starting to look like something.
However, I have right now 4 conkys working. Of course, you may agree with me, who could possibly live with
only 4 measly conkys on his computer?
That brings us to my question: I'm trying to learn how to pull the data from a website, to display it on conky. I know (Sector11 told me) that it involves using wget.
But, when I run a search, it directs me to this thread. Now, going through 2000+ pages on a slow, not always working wireless connection is a daunting task. Can anybody direct me to the information, or tell me how to get it?
Thanks in advance.
Use wget or curl to retrieve the html of the website.
Eg this site I use in one of my conkys
Code:
curl --retry 4 "http://www.srosurf.com" | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's/ / /g' > ~/conky/curl/surfreport.txt
The sed commands remove most of the html code then saves as...
surfreport.txt
Code:
"Perth Daily Surf Reports and forecasts"
HOME
NEWS
SURF REPORT / WIND & WAVES
REAL TIME SURF CHECK
FORECASTS
THIS IS A NON PROFIT SITE
:: Wallpaper
:: Surf
dictionary
:: Accomodation
:: Board repairs
:: Letters
:: Awards
:: About Marz
:: Services
:: Contact us
WIND & WAVES
:: Perth Metro
forecast
:: Perth Coast
:: Geograph Coast
:: Leeuwin Coast
:: Albany Coast
:: Esperance Coast
:: 4 Day forecast chart
:: Synoptic Charts
:: UV Forecast Perth
:: All West Oz forecasts
:: Aust Cyclone Track
:: Cyclone Warnings
COAST/SURF CAMS
:: Trigg
Point
:: Trigg Beach
South
:: Swanbourne
:: World Sea
Temps
:: Satellite
wind
sensors
:: World Satellite
Photo
:: Surface
winds
:: Aust
Satellite Photo
:: Radar
Image
:: Wind Strength
Scale
:: Weather
Dictionary
SROSURF.COM IS
INTERNATIONALLY RENOWNED
THE SURF REPORT
Select location by clicking on links below
PERTH
MANDURAH
MARGARET RIVER
.
Teusday 25/06/13
report filed: 7:10am
PERTH Metro Area
RECOMENDED BOARD FOR TODAY:
One from a West Australian company.
WIND: Light W/SW.
WAVES: Head to head high plus waves on the beach breaks.
COMMENTS: Plenty of swell on offer along the metro coast this morning, but unfortunately the wind is not doing us any favours. Beach breaks are pretty much maxing out, but the good news is plenty of swell along the reef breaks. Once that wind swings SW the protected reefs and groynes will be joy..
Rating: 1.5 out of 10.
Support your local shaper, support your local surf shop.
Check the latest swell/wind forecast
REMEMBER THE ONLY THING YOU SHOULD LEAVE ON THE BEACH ARE YOUR FOOTPRINTS, RUBBISH GOES IN THE BIN.
CLICK HERE
SWELL BUOYS
:: Swell Buoys
(ALL)
:: Cape
Naturaliste
:: Rottnest/Metro
:: Cottesloe
:: Jurien
CLICK HERE
SWELL FORECASTS
:: NOAA Wave
models
::
Current
swell Map
:: 24hr swell
forecast
:: 2 day swell
forecast
:: 3 day swell
forecast
:: 4 day swell
forecast
:: 5 day swell
forecast
:: 6 day swell
forecast
:: All Maps
:: Swell/Wind
maps
TIDES
:: Carnarvon
:: Geraldton
:: Perth
:: Fremantle
:: Mandurah
:: Bouvard
:: Bunbury
:: Naturaliste
:: Cowaramup
:: Augusta
:: Albany
:: Esperance
CONTACT US
|
ADVERTISE WITH SRO
|
DISCLAIMER NOTICE
|
COPYRIGHT NOTICE
|
ABOUT THE SURF REPORT
|
ACKNOWLEDGEMENTS
A West Australian
Production THE ORIGINAL AND STILL THE BEST Local surfers,
providing local
content...................Life is like a long wall on a wave. Every now and then a section
pops up that you have to make your way
around. Remember this, every wave is different, just like every day in your life will
be.....srosurf.com© 2002
SRO Western Australia's first premium Surfing Site the original and still the
best!
copyright 1996 SRO www.srosurf.com All rights reserved
IP, concept and design applies.
Then it's just a matter of putting that into conky.
I have various sites I get info from so I put all the curl commands in one
curl-template bash script.
Code:
#!/bin/bash
curl --retry 4 "ftp://ftp2.bom.gov.au/anon/gen/fwo/IDW12300.txt" > ~/conky/curl/bomforecast.txt
curl --retry 4 "http://www.bom.gov.au/wa/observations/perth.shtml" > ~/conky/curl/bomtemp
#curl --retry 4 'http://www.weather.com.au/' | grep -A4 Perth | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | tail -n1 | tr -d '\r' | tr -d [:blank:] > ~/conky/curl/maxtemp
curl --retry 4 "http://wap.seabreeze.com.au/state.asp?s=0000004" | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' > ~/conky/curl/sbwind
curl --retry 4 "http://www.srosurf.com" | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' | sed 's/ / /g' | sed 's/Support your local shaper, support your local surf shop.//g' > ~/conky/curl/surfreport.txt
curl --retry 4 'http://www.transport.wa.gov.au/imarine/coastaldata/tidesandwaves/stampgif_dg.asp?gfx=RDW_POLD' > ~/conky/curl/rottoswell.gif
curl --retry 4 "ftp://ftp2.bom.gov.au/anon/gen/fwo/IDW11400.txt" | tr "\r" " " | sed -e :a -e 's/<[^>]*>//g;/</N;//ba' > /home/glen/conky/curl/swell.txt
In conky, I use this to run the curl commands...
Code:
${execi 3600 ~/conky/curl/curl-template}
Then choose what to display in conky using cat.
Eg
Test in terminal...
Code:
glen@Raring:~$ cat ~/conky/curl/surfreport.txt | grep -m 1 "COMMENTS:" | fold -sw86
COMMENTS: Plenty of swell on offer along the metro coast this morning, but
unfortunately the wind is not doing us any favours. Beach breaks are pretty much
maxing out, but the good news is plenty of swell along the reef breaks. Once that
wind swings SW the protected reefs and groynes will be joy..
Then put into conky.
Code:
${execi 3600 cat ~/conky/curl/surfreport.txt | grep -m 1 "COMMENTS:" | fold -sw86}
The grep sed awk tr and fold commands I only have a basic knowledge of and just use the man pages
and google code snippets for the task I want to perform.
The attached pic shows surf and weather info grabbed from various
local websites and displayed in conky.
Bookmarks