You are not logged in.
Pages: 1
i made a stupid script again! time to celebrate!
it uses a bunch of text-files filled with words, and the script itself simply picks a random line from each file and puts them in order, building a sentence. you can expand the text-files however you like, as long as you keep in mind the build of the sentence (or not).
i am thinking of ways to have these files in some sort of central repository or whatever, storage, where everybody can add stuff to them, which in turn will end up inside everyone else's sentences. if you have any ideas on that, let me know.
here are the text-files, with the name you need to save them as (or a different name, but in that case you'd need to modify the script of course) (oh and save them in the same directory as your script, or it won't work):
saywhat.1a > http://pastebin.com/8MimcCbL
saywhat.1b > http://pastebin.com/qaHhAxdx
saywhat.2a > http://pastebin.com/LZciXUg1
saywhat.2b > http://pastebin.com/5d9r98eg
saywhat.3a > http://pastebin.com/34PFrafQ
saywhat.3b > http://pastebin.com/AutsjaCL
saywhat.4a > http://pastebin.com/GhKCmV4R
saywhat.4b > http://pastebin.com/fwLALPzM
saywhat.verb > http://pastebin.com/CcQyPid2
and here's the script itself, called 'saywhat'
#!/bin/bash
shuffle() {
RAND=$(od -d -N2 -An /dev/urandom)
LENGTH=$(cat "$1" | wc -l)
LINE=$(( RAND % LENGTH + 1 ))
head -$LINE $1 | tail -1
}
one_a=$(shuffle saywhat.1a)
one_b=$(shuffle saywhat.1b)
two_a=$(shuffle saywhat.2a)
two_b=$(shuffle saywhat.2b)
three_a=$(shuffle saywhat.3a)
three_b=$(shuffle saywhat.3b)
verb=$(shuffle saywhat.verb)
four_a=$(shuffle saywhat.4a)
four_b=$(shuffle saywhat.4b)
echo "$one_a, $one_b $two_a $two_b, that $three_a $three_b $verb $four_a $four_b."simply save that somewhere as 'saywhat.bash' or whatever, then do 'chmod +x saywhat.bash' and execute it, for the following (example) results:
i read in a book somewhere, curiously not while doing drugs, that scared Nickelback-listeners call the police on boring neighbours.
i have come to understand, suspiciously during a time of making backups, that introvert moviecritics have dinner while looking at adventurous payroll administrators.
it is understood, sometimes while not devouring sunflowers, that large amounts of clerks get angry about audacious followers.
it is commonly believed, particularly while not writing code, that insecure robots eat ridiculous aunts.
many people think, presumably immediately after realizing the importance of it all, that dreaming programmers eat swimming dogs.
my neighbour's cat is said to believe, presumably while consuming beverages, that feminine monks have trouble sitting down because of sexy neighbours.Offline
Offline
Thanks so much rhowaldt for this useful script! I pipe it into espeak/festival, then I have somebody who talks to me 
Offline
@orion: it is gone now. but can be read here: http://crunchbanglinux.org/forums/post/220051/#p220051
@baconboy: i'm glad i could be of help for your loneliness 
Offline
I have no idea why I think this is brilliant, but I do. Nice work, rhowaldt! 
Offline
Thank you for memorializing that moment of joy. :-D
一期一会 Let it be good.
My Screenshots - Blog
Offline
Great stuff!
...er, just...
irritatingly fastidious proofreaders notice, especially while not more gainfully occupied, that script generated sentences are failing to commence with capital letters.John
--------------------
( a boring Japan blog , and idle twitterings )
Offline
Strangely appropriate spammer.
I thought this was in reference to the generated text.
Brilliant!
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Online
@hinto: hey, i never heard of madlibs before! 
@johnraff: yes, indeed. i made it that way for 2 reasons:
1. it is the way i always write things (in case you didn't notice!)
2. i figured i'd do capitalization on the first word afterwards, instead of capitalizing the words in the text-file. however, i forgot. so feel free to add it yourself if you want to 
@the_rest_of_the_enthusiastic_people: thanks! i really like it too 
Offline
We can always count on you, rhowaldt, for a useless (yet diverting) wordy script! 
Punch all your friends.
Offline
^ you can say it is my specialty 
Offline
OK, for capital letter at start of sentences, how about:
#!/bin/bash
...stuff...
echo "${one_a^}, $one_b $two_a $two_b, that $three_a $three_b $verb $four_a $four_b."John
--------------------
( a boring Japan blog , and idle twitterings )
Offline
This is beautifully useless!!... or should I say uselessly brilliant?!
Either way, me likes.
You're definitely my favourite overdosed mutt, rhowaldt. =P
Last edited by gutterslob (2012-05-18 15:06:47)
Point & Squirt
Offline
^
thanks gutterslob!
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.