Skip to content

Instantly share code, notes, and snippets.

@kazoo04
Created March 21, 2014 12:45
Show Gist options
  • Save kazoo04/9685391 to your computer and use it in GitHub Desktop.
Save kazoo04/9685391 to your computer and use it in GitHub Desktop.
# 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