9

Brainyquote of the Day

Posted in Internet by mjb 2789 days ago

Huge shout out to Son Of Man post for inspiring most of this desktop.

I just wanted to add my first contribution to the community with someone close to my heart: quotes.

Code is here -

curl --silent www.brainyquote.com/quotes_of_the_day.html | egrep '(span class="huge")|(span class="big")' | sed -n '1p; 2p; ' | sed -e 's/<[^>]*>//g'

Edit which paragraphs are picked up by the first sed if you'd like a different quote from that page.


Geeklet files to download

Comments

User Avatar
Fen_Li 2788 days ago
your wallpaper looks nice..

can u share it ?

edit : i've found at original page..
User Avatar
mikesamuel8 2786 days ago
Love this, might I ask if you could help me. I love brainy quotes, particularly the quotes from Ernest Hemingway. Is there a way that I could get a quote from Hemingway's online collection to randomly display everyday on my desktop?
User Avatar
ProtoDrake 2782 days ago
Minor fix:

curl --silent www.brainyquote.com/quotes_of_the_day.html | egrep '(span class="huge")|(span class="big")' | sed -n '1p; 2p; ' | sed -e 's/]*>//g'

From that ^

curl --silent www.brainyquote.com/quotes_of_the_day.html | egrep '(span class="huge")|(span class="big")' | sed -n '10p; 11p; ' | sed -e 's/]*>//g'

To this ^

Their homepage recently had some changes. :D
User Avatar
gradientShift 2682 days ago
Love your background
User Avatar
max1977 2372 days ago
Think they might have changed the HTML behind the page again.

This works for me for the Quote of day:

curl -s www.brainyquote.com/quotes_of_the_day.html | egrep '(div class="bqQuoteLink")|(a href)' | sed -n '19p; 20p;' | sed 's/]*>//g'

Let me know if it works for you guys too!

:)

PS: having issue pasting the last sed command in here... it should read sed 's/< [ ^ >]*>//g' but without the spaces between < and >
User Avatar
stra2g13s 2368 days ago
Hey Max1977,

Thanks for the tip. However, it doesn't work for me - I get a lot of weird sentences (e.g. >div class="bqQuoteLink" (...)

Can you help me out?

Thanks!
User Avatar
stra2g13s 2371 days ago
Hey Max1977,

Thanks for the tip. However, it doesn't work for me - I get a lot of weird sentences (e.g. >div class="bqQuoteLink" (...)

Can you help me out?

Thanks!
User Avatar
max1977 2363 days ago
Please get the curl command from this website:

http://pastebin.com/QLANYFdz

as I'm having troubles pasting it into here directly!

Thanks,

Max
User Avatar
stra2g13s 2363 days ago
Works like a charm!

Thanks!

curl -s www.brainyquote.com/quotes_of_the_day.html | egrep '(div class="bqQuoteLink")|(a href)' | sed -n '19p; 20p;' | sed -e 's/]*>//g'
User Avatar
max1977 2041 days ago
New curl command updated as of 11.03.2014 can be found here:

http://pastebin.com/W8NkgB4Z

:)
User Avatar
hackson 1764 days ago
hi, i make a few changes to the original in order to fix some issues in the web site:

curl --silent www.brainyquote.com/quotes_of_the_day.html | egrep '(span class="bqQuoteLink")|(a href) ' | sed -n '1p;' | sed -e 's/]*>//g' && curl --silent www.brainyquote.com/quotes_of_the_day.html | egrep '(div class="bq-aut")|(a href) ' | sed -n '1p;' | sed -e 's/]*>//g'

the result looks like:

The past cannot be changed. The future is yet in your power.

Mary Pickford

Cheers!
User Avatar
max1977 921 days ago
CURL command updated with recent changes from brainyquote website can be found here: http://pastebin.com/TidByw2Z

Enjoy,

Max

Log in to comment or register here.