javascript - Greasemonkey- Picking random word(s) out of search engine results page -



javascript - Greasemonkey- Picking random word(s) out of search engine results page -

i working on little project seem stuck @ point. hopefully, of great people able help me out on this.

i trying figure out simple , efficient way of pick out random word or words page of search engine results. part stuck on.

after picking out, store word(s) in variable.

the search results this: http://i54.tinypic.com/34fllw1.png

thanks in advance. tips/help appreciated!

edit: there way able pick out string of consecutive words of random length?

here illustration works google.com

//get text var text=document.getelementbyid('rso').textcontent; //find words var words=text.match(/\b([a-z]{3,})\b/gi); //pick word alert(words[math.floor(words.length*math.random())]);

the searchresults listed in element id "rso". regexp matches strings consisting of @ to the lowest degree 3 chars a-z

javascript greasemonkey userscripts

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -