Home
Aren't we all just computer programs? [entries|friends|calendar]
adaptivesystems

[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

Catharsis [08 Feb 2005|08:45pm]
libGrouphug.py:
import string
import httplib
import sgmlStripper

def getRandomGrouphug():
connection = httplib.HTTPConnection("grouphug.us")
connection.request("GET","/random")
response = connection.getresponse()
data = response.read()

startPos = string.find(data,'<td class=\"conf-text\">') + 22
data = data[startPos:]
endPos = string.find(data,'</td>')
data = data[:endPos]

stripper = sgmlStripper.Stripper()

##warning, two different strip functions here #Note, this is a strip function from sgmlStripper to strip tags hug = stripper.strip(data) #this is the strip from string to strip beginning and trailing whitespace hug = string.strip(hug) return hug;

if __name__ == '__main__':
print getRandomGrouphug()



ljPoster.py:
import time
import urllib
import urllib2

class ljPoster:
"""class to create an object that can log into and post on Livejournal.com and other sites which use
the same code such as Deadjournal.com"""
def __init__(self,username,password,server="http://www.livejournal.com"):
"""constructor requires username and password""" self.username = username self.password = password self.server = server def post(self,subject,body):
"""Post to livejournal""" #subject may only be 255 chars subject = subject[:255] #lets get the date in the tuple since LJ.com wants the local date or they won't post dateTuple = time.localtime() #lets create a dict self.ljRequest = { 'user':self.username,
'password':self.password,
'mode':"postevent",
'lineendings':'\n',
'subject':subject,
'event':body,
'year':dateTuple[0],
'mon':dateTuple[1],
'day':dateTuple[2],
'hour':dateTuple[3],
'min':dateTuple[4]
}
#doing the actual posting data = urllib.urlencode(self.ljRequest) post = urllib2.urlopen("http://www.livejournal.com/interface/flat",data)
return post


if __name__ == "__main__":
"""user should never invoke this as __main__ ...""" print "This is a library"



sgmlStripper.py:
#SGML stripper class, inherited from SGMLParser

import sgmllib

class Stripper(sgmllib.SGMLParser):

def __init__(self):
sgmllib.SGMLParser.__init__(self)

def strip(self, some_html):
"""Given a SGML/HTML string, strip tags""" self.theString = "" self.feed(some_html) self.close() return self.theString

def handle_data(self, data):
"""Given a string, append to Stripper object's current data""" self.theString += data



adaptiveSystems.py:
import libGrouphug
import ljPoster
import time
import random

"""Create a livejournal robot""" #paste your LJ login info here myLivejournal = ljPoster.ljPoster("AdaptiveSystems","mypassword")

while (1):
myLivejournal.post(" ",libGrouphug.getRandomGrouphug())



3 comments|post comment

[08 Feb 2005|02:14pm]
when i was young my grandfather had this little mexican dog named Buddy. He loved the dog so much and he had him for over fifteen years. I used to hate the dog and i would beat him constantly just because he was annoying me. Sometimes I would put liqour in his doggy bowl. Then one day I was practicing shooting my dads rifle and buddy was outside. I used him for target practice and I did pretty good because i killed the little shit deader than a doornail. I never told my grandpa and he took a long time to get over it. He was such a fucking pussy.
post comment

[08 Feb 2005|02:14pm]
I am in love with a guy from my Earth and Space Sciences class. I'm too shy to talk to him and will never get past staring at him wistfully from a few seats away.
I've become extremely insecure since my last boyfriend dumped me and I'm afraid I will never have a boyfriend again.
1 comment|post comment

[08 Feb 2005|02:14pm]
I consistently pretend I don?t know what going to happen when my ex calls and asks me to hang out. I also pretend he doesn?t have a boyfriend.
post comment

[08 Feb 2005|02:14pm]
When someone pisses me off, I become obsessed and consumed by my hatred for them. It is really crippling. I will spend hours at work just looking them up on the internet trying to find as much information on them as possible, and I won't get anything else done all day. What I do with all this information I acquire? Nothing. Just sit around and hate them even more, wishing zits and scars on them. I know that I am only wasting my own time and that this person doesn't care enough about me to hate me back, but I can't stop stalking her. I can barely even remember why I hate her so much to begin with.
post comment

[08 Feb 2005|02:14pm]
When I was 15 and living at a boarding school, there was a huge spider in my bathroom. I was afraid to shower and go to class so I stayed in my room all day. Eventually I had to pee but was still scared of the spider, so I pissed inside an empty apple juice container and quickly poured it down the sink. My roommate later figured out what I did and laughed.
post comment

[08 Feb 2005|02:14pm]
I fancy my dead friends sister.
post comment

[08 Feb 2005|02:14pm]
i have stolen from my friends lots of times, usually to pay for drugs
post comment

[08 Feb 2005|02:14pm]
I'm in love with this guy that I fear might be gay.
post comment

[08 Feb 2005|02:14pm]
i consider myself effectively not human. i like to think others consider me this way. i dont feel i deserve to have my feelings taken into consideration in any matter, and somehow this makes me more content than if i think that everyone is really my friend. thinking anything they say is just because they dont want to be mean is a comforting thought.
post comment

[08 Feb 2005|02:14pm]
i slept with a guy who smelled like shit...it was the most horrible sex i ever had...and then i had to sleep over ....i couldnt wait to get out of there..
post comment

[08 Feb 2005|02:14pm]
When I was a young lad in Thailand, I used to catch and release amphibians. One time, I captured a toad the size of my fist and put it in a nondraining pot with water. I then placed another pot on top of that pot to submerge the toad (for reasons that have been lost in time like water in rain). But, because I was preoccupied with something else, I completely forgot about the poor toad. I came back hours later and found him bloated and waterlogged. He'd died. I find this same kind of attention deficiency when it comes to cooking. One time I was boiling a pot of water to make soup. The next morning I found the pot still cooking. The water had evaporated probably hours before, and the pot, well...this is when I discovered another material incorporated into the S.S./copper pot manufacturing. I found a baked, charcoal-crisp layer of coating of something on the bottom. The pot had overheated and this layer had been baked right off. To hide my mistake from my mother, I went to ace hardware and bough steel wool and 1500 grit sandpaper. I tried to polish the copper and crapped-on stainlish steal. I just made it worse. Now, everytime someone touches the base with their oily fingers, the copper oxidizes with a toxic-looking rust (caustic brown instead of green). Nobody has even brought up the unusual appearence of it.
post comment

[08 Feb 2005|02:14pm]
I got drunk one night and started kicking a football around with my friend. I got hit in the face and got a terrible nose bleed. I went over to this girls dorm and shot blood out of my nose all over their door and then started wiping it around because I thought it was funny.
post comment

[08 Feb 2005|02:14pm]
i think my libido is dead. i never want to have sex or anything leading up to it. i always tell my boyfriend im not in the mood but we always end up doing something. i feel bad for myself because i don't want to do it, but i do it just to please him. nothing seems to turn me on anymore. im only 18.
post comment

[08 Feb 2005|02:14pm]
I hate all my friends. I bitch about them to each other all the time. Theyre just so annoying though! They're always trying to be better at me in whatever I do. I want to stab them.
post comment

[08 Feb 2005|02:14pm]
I have to beg my girlfriend to bite down when she is giving me head. She thinks it's weird and is apprehensive about it. I think it's great.
post comment

[08 Feb 2005|02:14pm]
I'm a stripper, and my mom doesn't know, she nearly caught me though when she came to the club i work at with her new boyfriend, it makes me mad that he would take her to a place like that.

I wish i could tell her so but i would have to let her know what i do at night, and i just can't do that, it makes me feel guilty that my mother won't know how bad this guy is.
post comment

[08 Feb 2005|02:14pm]
i look under skirts
post comment

[08 Feb 2005|02:14pm]
I once wanked to the in-flight movie on a plane under a blanket and came in my pants. I was sitting next to my mum. I went to the toilet and cleaned myself up. Everybody near me was sound asleep so nobody noticed.
post comment

[08 Feb 2005|02:14pm]
i work in a book shop and i hate customers so much i rip out random pages from books
post comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]

Advertisement