I HAVE CREATED A MONSTER.
Posted by Gold Prognosticus Nov 12 2012 18:34 GMT in Gold Prognosticus
- Like?

Behold the culmination of 4 and a half hours' work. Nerr_ebooks will, either by manual command or on its own over time, pull a random quote from the depths of Old Digi, squish it to fit 140 characters and post it to Twitter like a good little robot. It's completely pointless and certainly unoriginal, but it was a fun way for me to practice some coding and it may produce some amusing results as time goes on.


Replies:

u so crazy. how does it work?
Reply by Francis Nov 12 2012 19:07 GMT

The bash script picks a random number between the lowest post number on old Digi and the highest I could find at the time, then calls viewtopic.php?p=<number> to get the page for that post. It then runs the HTML through a series of string filters to find the specific post message, cut out any remaining tags and remove any leading whitespace or line breaks, then chops it down to a maximum of 140 characters. It then sends the resultant string to some open-source code which publishes the tweet via the Twitter API.

Reply by Gold Prognosticus Nov 12 2012 19:20 GMT
looking forward to my 2008 faggotry resurfacing
Reply by Super-Claus Nov 12 2012 19:39 GMT
First automated post should be at 9pm GMT and then every three hours after that, but if it grabs an invalid post ID it just gives up and waits until the next check, so things should balance out. It's an easy enough case to tweak the timing though if it goes too fast or too slow.
Reply by Gold Prognosticus Nov 12 2012 20:41 GMT
i wonder if i'd even recognize any of my posts
Reply by Nastasia Nov 12 2012 21:02 GMT
Know the secret? This thread is lame! I'm now going to chargify it with thrills in the next ten seconds! oooooonnnneeee...... twooooo
Reply by Slim Nov 12 2012 21:21 GMT
I love how 80% of the posts seem to originate from RP/RPOT.
Reply by Gold Prognosticus Nov 13 2012 00:22 GMT
are you sure its not 100% of the posts
you better check you didnt have the wrong link
Reply by Nastasia Nov 13 2012 18:18 GMT
Sign-in to post a reply.