Skip to content

Instantly share code, notes, and snippets.

View Artaud's full-sized avatar

Jiří Richter Artaud

  • Urbandroid Team
  • Prague, Czech Republic
View GitHub Profile
@Artaud
Artaud / _sleepbot-migrate-to-sleep_as_android.rb
Last active January 15, 2017 15:25 — forked from T3chArmy/readme
Migrates SleepBot data to Sleep as Android's format. Updated by the author of Sleep as Android.
require 'csv'
# Parses CSV-exported data from SleepBot
def parse_export(row)
# Parse the wake up date
date_to = row[0].tr("'","").split('-')
date_to = Time.new(date_to[2].to_i, date_to[1], date_to[0])
# Parse the wake up/sleep times
time_from = row[1].tr("'","").split(':')