henry_flower (
henry_flower) wrote2011-04-09 11:55 pm
Как постоянно быть в топе Хабрахабра
# fill our credentials
h = Habrahabr.new 'hakir_vasia', '12345'
loop {
r = HackerNews.new.sort :bycomments # return an array of hashes
# get 3 articles, translate & post them
r[0..2].each {|i|
html = Translate.html :english, :russian, i[:article]
if html.images == 0
html.insert(GoogleImages.new(:random))
html.insert(YandexImages.new(:random))
end
h.post html
}
sleep 60*60*24 # 1 day
}
