samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 116 forks source link

sync entries from different devices #33

Open kjowens opened 13 years ago

kjowens commented 13 years ago

if i'm working on a remote computer, i'd like to be able to write commands into a file, sync it via dropbox, then when i get home, have timetrap parse the comands to enter them into the database. something like:

$ t --batch "~/dropbox/my_timetrap_data.txt"

samg commented 13 years ago

I'm pretty interested in this idea. I've toyed with the idea of creating some kind of webservice that would allow timetrap to be synced among multiple machines, and provide a web interface to your time.

One fairly easy way to accomplish this now would be to export your time entries (as csv or one of the other provided formats) and then write a simple script that would iterate over the exported files and invoke the appropriate in, out, and edit commands to recreate the entries.

Also the location of the sqlite database file is configurable (via t configure), and I believe some people have succeeded in placing it in a network mounted storage to allow multiple machines to access the same db.

chesles commented 12 years ago

I just started using timetrap, and it's a pretty great little utility!

Perhaps a command like t sync [url/filename] would be useful. This way you could sync with, say, a CouchDB server or some web service by importing the JSON data and/or writing updates to the file/web service.

Something like this workflow could be really neat:

$ t remote add http://some-web-service.com/restful/api
$ t sync # syncs with the configured RESTful API(s)
samg commented 12 years ago

Glad you're enjoying the tool.

I definitely like the idea of being able to sync timetrap entries with a remote service (and then potentially across multiple machines you're using), though I've never gotten around to developing. There was a time when I even considered developing a web service (like what you describe) that could be a freemium add on to the open source cli tool.

It does get tricky handling all of the add/delete/merge logic that comes from having data pushed/pulled from multiple sources. I doubt I'll have a chance to attempt it any time soon, but if you want to take a crack at it definitely send a pull request and I'll consider incorporating it into the core gem.

Thanks!