Generating nixers introductions with the shell. - Programming On Unix

Users browsing this thread: 2 Guest(s)
pranomostro
Long time nixers
Hello, children. Today I will walk you through letting
the computer generate an introduction to the nixers forum,
automatically!

It is very easy.

First, you run this command:
Code:
curl http://venam.nixers.net/nixers_intro.html | awk '/div class="code">/ { p=1 } p { print($0) } /<\/div/ { p=0}' | sed 's/<[^>]\+>//' | awk '$0!~/^$/ { print($0) }' | sed 's/^ //' >intros

This downloads a bunch of existing nixers introductions from
venams website (I really hope he updates that one day so that
we have EVEN MORE DATA!).

Then you download a neat little markov chain generator by mpu (godlike!):

Code:
curl http://c9x.me/cbits/markov.c >markov.c
curl http://c9x.me/cbits/avl.c >avl.c
#compile the code
cc avl.c markov.c -o markov

Now, we're ready to go!

Our intro will contain of 10 unstructured, hilarious sentences.

We run

Code:
./markov -c 10 intros

The result may look somewhat like this:

Code:
>>> god is here to learn.
>>> i signed up before lurking much so.
>>> have a nice evening all.
>>> i will probably end up using both however.
>>> beneath all computer-related stuff i m not as proficient in coding as many of you are.
>>> almost everyone ignored my questions with the exception of a user called venam who sarcastically gave me the advice to install gentoo.
>>> my dream career is to one day work with linux nix systems.
>>> i don t have a girlfriend don t have a girlfriend don t have to watch what i post because i d have cringed at whatever i d written here so i m going to college for essentially programming and i m still very much a novice at all this and have settled for what works for me although i m back on wmii since around a month - really like the tagging way of managing windows and yes i m aware about i3 but i don t know i m reki from hf.
>>> what certs should i look into.
>>> i really like its content.
>>> i m planning to real soon.

I especially like the last sentence generated. It sums up the community pretty well. This enthusiastic, but also slightly insane
style of language.

I hope you liked my little excurse into 'just using a utility'.

Have a nice day.


Messages In This Thread
Generating nixers introductions with the shell. - by pranomostro - 18-04-2016, 04:42 PM