Rbb-push is a project mainly written in Ruby, it's free.
BlackBerry PUSH API for Ruby
See example/simple.rb