Ruby script to compute and post summaries to Basecamp

It's no secret that we use basecamp a lot and love it.

About a year ago, some of our clients wanted to be able to log in somewhere and see a status of how many hours they had left on their retainer, or how much their bill would be at the end of the month.

So I came up with a quick and dirty script that does the following:

  • logs into basecamp
  • iterates through each client
  • looks for a configuration message in a pre-defined category (stored as YAML)
  • does it's calculations based on the configuration
  • posts the results back to basecamp under another pre-defined category

Here's a sample configuration message for a basic maintenance client:

Hours: 2
Run Dates: 10, 20

This tells the script that the client purchased 2 hours of support each month, and that the script should post status updates on the 10th and on the 20th of each month.

Here's a more complex example:

Limit: 1000
Developer A: 75
Developer B: 45
Run Dates: 10, 20

This tells the script that the client has a dollar limit of $1,000 a month, and the two developers assigned to it bill out at $75 and $45 per hour. It's also set to post results on the 10th and 20th of each month.

Again, not rocket science, but allowed us to provide clients with an automated status update so they could keep a handle on costs.

I'm posting it here to share as something neat, but please bear in mind that it comes with no warranty of any kind. It worked well enough for us, ymmv.

Let us know what you think!

AttachmentSize
main.rb3.16 KB

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.