Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Random REBOL code

From: ryan:christiansen:intellisol at: 23-May-2001 16:55

I've updated my experiment in REBOL-generated art at If you get an error, it's because the server which generates the words did not return anything. I have an if error? try statement which is supposed to kick in when there is an error, but it doesn't. Not sure about that one. Here's the code... REBOL [] words-to-ignore: { a about above according across actually adj after afterwards again against all almost alone along already also although always among amongst an and another any anyhow anyone anything anywhere are aren't around as at b be became because become becomes becoming been before beforehand begin beginning behind being below beside besides between beyond billion both but by c can can't cannot caption co co. could couldn't d did didn't do does doesn't don't down during e each eg eight eighty either else elsewhere end ending enough etc even ever every everyone everything everywhere except f few fifty first five for former formerly forty found four from further g h had has hasn't have haven't he he'd he'll he's hence her here here's hereafter hereby herein hereupon hers herself him himself his how however hundred i i'd i'll i'm i've ie if in inc. indeed instead into is isn't it it's its itself j k l last later latter latterly least less let let's like likely ltd m made make makes many maybe me meantime meanwhile might million miss more moreover most mostly mr mrs much must my myself n namely neither never nevertheless next nine ninety no nobody none nonetheless noone nor not nothing now nowhere o of off often on once one one's only onto or other others otherwise our ours ourselves out over overall own p per perhaps q r rather recent recently s same seem seemed seeming seems seven seventy several she she'd she'll she's should shouldn't since six sixty so some somehow someone something sometime sometimes somewhere still stop stoplist such t taking ten than that that'll that's that've the their them themselves then thence there there'd there'll there're there's there've thereafter thereby therefore therein thereupon these they they'd they'll they're they've thirty this those though thousand three through throughout thru thus to together too toward towards trillion twenty two u under unless unlike unlikely until up upon us used using v very via w was wasn't we we'd we'll we're we've well were weren't what what'll what's what've whatever when whence whenever where where's whereafter whereas whereby wherein whereupon wherever whether which while whither who who'd who'll who's whoever whole whom whomever whose why will with within without won't would wouldn't x y yes yet you you'd you'll you're you've your yours yourself yourselves z } get-thumbnail: func [ keyword [string!] ][ page: read (make url! rejoin [{} keyword {&hidKeywordSearch=&hidSearchCategory=0&pf=&navid=&hidIsNewSearch=TRUE}]) parse page [to {} copy text thru {.jpg} (img-url: make url! copy text)] img: read/binary img-url img-file: make file! (rejoin [keyword {.jpg}]) write/binary img-file img ] print "Content-Type: text/html^/" ;-- Required Page Header if error? try [quote-page: read parse quote-page [thru <FONT SIZE=+0> copy text to </FONT> (quote: copy text)]][quote: {I always wanted to visit California and look at all the cute chicks}] quote-words: parse quote none foreach quote-word quote-words [ if find words-to-ignore quote-word [replace quote-words quote-word ""] ] print rejoin [{<H1>} quote {</H1>}] foreach remaining-word quote-words [ if error? try [ existing-image: make file! (rejoin [remaining-word {.jpg}]) directory: read %. either remaining-word = "" [ next quote-words ][ either find directory existing-image [ print rejoin [{<IMG SRC="} remaining-word {.jpg">}] ][ get-thumbnail remaining-word wait 1 print rejoin [{<IMG SRC="} remaining-word {.jpg">}] ] ] ][ next quote-words ] ] -Ryan