summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/twitter.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/data/rbot/plugins/twitter.rb b/data/rbot/plugins/twitter.rb
index b29f51b4..a9ccd9c2 100644
--- a/data/rbot/plugins/twitter.rb
+++ b/data/rbot/plugins/twitter.rb
@@ -66,9 +66,10 @@ class TwitterPlugin < Plugin
begin
rex = REXML::Document.new(response)
rex.root.elements.each("status") { |st|
- month, day, hour, min, sec, year = st.elements['created_at'].text.match(/\w+ (\w+) (\d+) (\d+):(\d+):(\d+) \S+ (\d+)/)[1..6]
- debug [year, month, day, hour, min, sec].inspect
- time = Time.local(year.to_i, month, day.to_i, hour.to_i, min.to_i, sec.to_i)
+ # month, day, hour, min, sec, year = st.elements['created_at'].text.match(/\w+ (\w+) (\d+) (\d+):(\d+):(\d+) \S+ (\d+)/)[1..6]
+ # debug [year, month, day, hour, min, sec].inspect
+ # time = Time.local(year.to_i, month, day.to_i, hour.to_i, min.to_i, sec.to_i)
+ time = Time.parse(st.elements['created_at'].text)
now = Time.now
delta = now - time
msg = st.elements['text'].to_s + " (#{Utils.secs_to_string(delta.to_i)} ago via #{st.elements['source'].to_s})"