| Premshree Pillai ( @ 2004-08-04 17:48:00 |
Celebrating the self
I want to read a book that would make me happy about myself. No, don't get the wrong idea ... I am not depressed with life or anything of that sort. I don't know why, but I don't understand why I have to be surrounded by ineptitude all the time. I deserve better, don't I?
I try not to bother about things around me. Sometimes it works, but most of the times it doesn't. I want to take my mind off these things. I don't necessarily want to read something that makes me happy about myself... but I don't see another way. At least by way of shrouding myself with being happy about myself I can stop bothering about all the maladroitness that seem to perpetually surround me.
Reading a book that celebrates humanity might help.... But on second thoughts, that would kill my ego for some time ... and that's probably not a good thing.
I think I want to read something that would have the exact opposite effect of what I assume Atlas Shrugged would have. Suggestions?
In other stuff, I have been playing around with a few programming languages—to find one that would serve most of my purposes well. Today I played with Ruby. Of course, I cannot make any judgement... so soon. Anyway, to begin with, I coded yet another SMS to LiveJournal Gateway.
I want to read a book that would make me happy about myself. No, don't get the wrong idea ... I am not depressed with life or anything of that sort. I don't know why, but I don't understand why I have to be surrounded by ineptitude all the time. I deserve better, don't I?
I try not to bother about things around me. Sometimes it works, but most of the times it doesn't. I want to take my mind off these things. I don't necessarily want to read something that makes me happy about myself... but I don't see another way. At least by way of shrouding myself with being happy about myself I can stop bothering about all the maladroitness that seem to perpetually surround me.
Reading a book that celebrates humanity might help.... But on second thoughts, that would kill my ego for some time ... and that's probably not a good thing.
I think I want to read something that would have the exact opposite effect of what I assume Atlas Shrugged would have. Suggestions?
In other stuff, I have been playing around with a few programming languages—to find one that would serve most of my purposes well. Today I played with Ruby. Of course, I cannot make any judgement... so soon. Anyway, to begin with, I coded yet another SMS to LiveJournal Gateway.
#################################################
#
# $sms2lj.rb$ $version 1.0.0$ <5:22 PM 8/4/2004>
# Ruby based SMS to LiveJournal gateway
#
# Copyright (C) 2004 Premshree Pillai.
# <http://premshree.livejournal.com/>
#
#################################################
require 'cgi'
require 'net/http'
require 'net/pop'
class SMS2LJ
def initialize(lj_user, lj_password, journal, pop3_host, pop3_user, pop3_password)
@lj_user = lj_user
@lj_password = lj_password
@journal = journal
@pop3_host = pop3_host
@pop3_user = pop3_user
@pop3_password = pop3_password
end
def httpPost(subject, content)
h = Net::HTTP.new("www.livejournal.com", 80)
resp, body = h.post("/interface/flat",
"mode=" + CGI.escape("postevent") +
"&user=" + CGI.escape(@lj_user) +
"&password=" + CGI.escape(@lj_password) +
"&event=" + CGI.escape(content) +
"&lineendings=" + CGI.escape("pc") +
"&subject=" + CGI.escape(subject) +
"&year=" + CGI.escape("#{Time.now.year}") +
"&mon=" + CGI.escape("#{Time.now.mon}") +
"&day=" + CGI.escape("#{Time.now.day}") +
"&hour=" + CGI.escape("#{Time.now.hour}") +
"&min=" + CGI.escape("#{Time.now.min}") +
"&usejournal=" + CGI.escape(@journal)
)
end
def getMails
pop = Net::POP3.new(@pop3_host)
pop.start(@pop3_user, @pop3_password)
if !pop.mails.empty?
pop.each_mail do |m|
mail = m.pop
mail_lines = mail.split(/\r\n/)
httpPost("", mail_lines[mail_lines.length - 1])
puts mail_lines[mail_lines.length - 1]
m.delete
end
end
pop.finish
end
end
# LiveJournal config
LJ_USER = "*****"
LJ_PASSWORD = "*****"
JOURNAL = "*****"
# POP3 config
POP3_HOST = "*****"
POP3_USER = "*****"
POP3_PASSWORD = "*****"
# Sleep config
SLEEP_PERIOD = 10 # in seconds
obj = SMS2LJ.new(LJ_USER, LJ_PASSWORD, JOURNAL, POP3_HOST, POP3_USER, POP3_PASSWORD)
while 1
obj.getMails
sleep SLEEP_PERIOD
end