Created
March 21, 2014 12:45
-
-
Save kazoo04/9685391 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'date' | |
require './timer.rb' | |
@last_update = nil | |
def tweet | |
d = DateTime.now | |
return if @last_update and @last_update.hour == d.hour | |
if d.hour == 21 | |
p 'update' | |
end | |
@last_update = d | |
end | |
timer = Timer.new(1) { | |
Thread.new() { | |
p 'tweet()' | |
tweet | |
} | |
} | |
timer.start | |
loop do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment