Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: regex to get random quote

by choroba (Cardinal)
on May 16, 2016 at 07:46 UTC ( [id://1163117]=note: print w/replies, xml ) Need Help??


in reply to Re^2: regex to get random quote
in thread regex to get random quote

> Had I gone with the runner-up

Pagination would make it a bit more complex, but to get just the first page's quotes is similarly easy:

open :F html :r http://www.brainyquote.com/quotes/keywords/gratitude.h +tml ; my $i = 0 ; for //a[@title='view quote'] echo :s {++$i} '. ' (.) ;

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1163117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found