Skip to content

jimmynguyc/freshbook_timesheet_logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freshbook Timesheet Logger

Timesheet logger for lazy people

Why use this

Allows you to timelog in bulk. When you're the king of procrasti-nation, there's really a lot of other / better things to do.

Requirements

  1. Ruby (duh)
  2. Chrome

How to use this

  1. bundle install

  2. Copy .env.sample to .env and edit its content.

USERNAME=fixme
PASSWORD='fixme'
FRESHBOOK_URL = "https://fixme.freshbooks.com/"
  1. Copy config.sample.rb to config.rb and edit its content.
CONFIG = {}

CONFIG['holidays'] = []
# CONFIG['holidays'] << 'YYYY-MM-DD'

CONFIG['Mon'] = []
# CONFIG['Mon'] << ['Project',  'Task', 'Hours', 'Notes']

CONFIG['Tue'] = []
# CONFIG['Tue'] << ['Project',  'Task', 'Hours', 'Notes']

CONFIG['Wed'] = []
# CONFIG['Wed'] << ['Project',  'Task', 'Hours', 'Notes']

CONFIG['Thu'] = []
# CONFIG['Thu'] << ['Project',  'Task', 'Hours', 'Notes']

CONFIG['Fri'] = []
# CONFIG['Fri'] << ['Project',  'Task', 'Hours', 'Notes']
  1. Run the script
bundle exec ruby app.rb # Log today
DATE=2018-05-15 bundle exec ruby app.rb # Log specific date
FROM=2018-05-01 TO=2018-05-31 bundle exec ruby app.rb  # When you procrastinate until the last minute

Notes / Known Issues

  1. Will only log on a day where there's no existing time logs. Comment out these lines if you wish to ignore :-
# app.rb
unless page.find('.timesheet-entry-table').has_content?('No hours logged on')
  puts "Already Logged on #{date.strftime}!!"
  return
end
  1. This obviously only works if you have a pretty similar work schedule every day of week.

  2. There's no UNDO button. Make sure you know what you're doing.

  3. Things will break when the UI changes.

  4. You'll get your login will temporarily blocked if you fire the script too many frequently.

  5. Contributions are welcomed.

Why are you not using the API?

Because why use a scalpel when you have a chainsaw >:)

But seriously .. there's an official API

If you can't handle the action & excitement, check out the oauth branch. But seriously, you're missing all the fun.

License

This project is Licensed under GLWTPL

About

Freshbooks Timesheet logger for lazy people

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages