1
0
mirror of https://github.com/elisspace/FxLifeSheet.git synced 2026-08-29 15:44:00 +00:00

Remove old rescue_time importer

This commit is contained in:
Felix Krause
2022-03-11 14:11:26 +01:00
parent fb02036b6c
commit 3fe6c39a86
4 changed files with 0 additions and 57 deletions

View File

@@ -1,3 +0,0 @@
source "https://rubygems.org"
gem "pry"

View File

@@ -1,17 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
coderay (1.1.2)
method_source (0.9.2)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
PLATFORMS
ruby
DEPENDENCIES
pry
BUNDLED WITH
2.0.1

View File

@@ -1,9 +0,0 @@
# Rescuetime
Copy the latest archive from [https://www.rescuetime.com/accounts/your-data](https://www.rescuetime.com/accounts/your-data) to this folder, unzipped (the `.csv` file)
```
bundle exec ruby run.rb
```
Upload `computer_usage.csv` to the bot

View File

@@ -1,28 +0,0 @@
require 'csv'
require 'date'
file = "rescuetime-activity-history.csv"
puts "starting to parse #{file}, this might take a while"
data = CSV.read(file) # this has `1,137,918` rows in my case
final_data = {}
data.each do |row|
# => ["2013-08-22 00:00:00 -0700", "adium", "No Details", "Communication & Scheduling", "Instant Message", "222"]
date = Date.parse(row[0])
minutes = row[5]
final_data[date] ||= 0
final_data[date] += minutes.to_i
end
csv = "Date;dailyComputerUse"
final_data.each do |date, value|
csv << "\n#{date.strftime("%d.%m.%Y")};#{(value / 60.0).round}"
end
puts csv
File.write("computer_usage.csv", csv)