PDA

View Full Version : Conky to grab a single line from a webpage?



FatBoyNotSoSlim
January 13th, 2010, 01:32 PM
Hi all,
I have tried to search for this, and considered posting it in the previous conky threads, but most were tailored towards screenshots and scripts.

Ok, a few weeks ago the website I was using to get exchange rate data from, switched off their RSS feeds, and I'm finally getting around to fixing it.

I havent found any new RSS feeds, but i did find that google has a nice clean page to get values.

I'm trying to pull the text "1 AUD = 0.9235 USD" from here: http://www.google.com/finance/converter?a=1&from=AUD&to=USD .

i've tried directly calling wget with:
${execi 3600 wget -O - http://www.google.com/finance/converter?a=1&from=AUD&to=USD}
And even messed around with some conditions like 'tail' and 'cut' but its still showing the full html in my conky.

Googling for uses of wget with conky haven't worked, since a lot of guides are simply referencing how to install conky in the same post.

Any help would be greatly apreciated.

mobilediesel
January 13th, 2010, 04:05 PM
Hi all,
I have tried to search for this, and considered posting it in the previous conky threads, but most were tailored towards screenshots and scripts.

Ok, a few weeks ago the website I was using to get exchange rate data from, switched off their RSS feeds, and I'm finally getting around to fixing it.

I havent found any new RSS feeds, but i did find that google has a nice clean page to get values.

I'm trying to pull the text "1 AUD = 0.9235 USD" from here: http://www.google.com/finance/converter?a=1&from=AUD&to=USD .

i've tried directly calling wget with:
${execi 3600 wget -O - http://www.google.com/finance/converter?a=1&from=AUD&to=USD}
And even messed around with some conditions like 'tail' and 'cut' but its still showing the full html in my conky.

Googling for uses of wget with conky haven't worked, since a lot of guides are simply referencing how to install conky in the same post.

Any help would be greatly apreciated.

Try this:

${execi 3600 wget -q -O - "http://www.google.com/finance/converter?a=1&from=AUD&to=USD"|grep "<div id=currency_converter_result>"|sed 's/<[^>]*>//g'}

FatBoyNotSoSlim
January 13th, 2010, 10:09 PM
Worked perfectly, thank you.

GrouchyGaijin
December 27th, 2010, 11:44 PM
Thanks - this was exactly what I was looking for.

sbjaved
February 12th, 2012, 02:01 PM
Thankyou.

overdrank
February 12th, 2012, 04:04 PM
Back to sleep thread. Thread closed.