Skip to content

Instantly share code, notes, and snippets.

@supaspoida
Created July 24, 2009 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save supaspoida/154544 to your computer and use it in GitHub Desktop.
Save supaspoida/154544 to your computer and use it in GitHub Desktop.
~/repos/harvest$ irb
>> require 'harvest'
=> true
@harvest = Harvest(:email => "tomatoist@supaspoida.com",
:password => "123456",
:sub_domain => "tomatoist",
:headers => {"User-Agent" => "Tomatoist", 'Content-Type' => 'application/xml' })
@harvest.timesheet.new(:hours => 3, :notes => 'workdammit', :project_id => 388131, :task_id => 319119, :spent_at => Date.today).save
## This is the request that is generated
<?xml version="1.0" encoding="UTF-8"?>
<request>
<project-id nil="true"></project-id>
<task-id nil="true"></task-id>
<spent-at type="date">2009-07-24</spent-at>
<hours>3</hours>
<notes>workdammit</notes>
</request>
## And the response
Failed with 500 Internal Server Error
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment