Skip to content

Commit

Permalink
Merge pull request ttscoff#146 from drallgood/facebookifttt
Browse files Browse the repository at this point in the history
fixed facebookifttt plugin issue with times between 12pm and 1pm
  • Loading branch information
ttscoff committed May 9, 2013
2 parents 4d32224 + 384172b commit 764f17c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions plugins_disabled/facebookifttt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
- You should set facebook_ifttt_input_file to this value, substituting username appropriately.
=end

require 'date'

config = {
'description' => ['Parses Facebook posts logged by IFTTT.com',
'facebook_ifttt_input_file is a string pointing to the location of the file created by IFTTT.',
Expand Down Expand Up @@ -90,14 +92,8 @@ def do_log
line = line.gsub(',', '')

month, day, year, time = line.split
hour,min = time.split(/:/)
min = min.gsub(ampm, '')

if line =~ pm
x = hour.to_i
x += 12
hour = x.to_s
end
parseTime = DateTime.parse(time).strftime("%H:%M")
hour,min = parseTime.split(/:/)

month = Date::MONTHNAMES.index(month)
ltime = Time.local(year, month, day, hour, min, 0, 0)
Expand Down

0 comments on commit 764f17c

Please sign in to comment.