Skip to content

Instantly share code, notes, and snippets.

require 'hpricot'
require 'open-uri'
require 'date'
class Post
attr_accessor :author, :title, :date, :tags, :comments
def initialize url
doc = Hpricot(open(url))
@author = doc.search("//author/name").fetch(1).inner_text

Tweeting on behalf of users is bad

I just got trapped by Prismatic who tweeted a metric ton of messages on my twitter account. I do not want to pick on Prismatic who is probably a great product otherwise. However this is clearly a pattern that we've all seen too many times and this has to stop.

Before anything else, I could have very well done a mistake and hit the wrong buttons/settings. I am not putting the blame on Prismatic, but on this crazy system that allows machines to post on my behalf. No matter what, though, they should obviously prevent me from doing something that dumb, if that's my fault.

What happened

id := line[0]
length , err := strconv.ParseInt(line[1], 10, 64)
if err != nil{
log.Printf("Error parsing duration - empty? %v", err)
length = 0
}
//The DAY component of this may be wrong, but the time will be correct, in GMT
//The day will be an arbitrary day between 1970 and 1974. Ignore it.
time, err := strconv.ParseInt(line[2], 10, 64)