Hopefully the new version of our API would make that kind of thing easier in the future since it's very thoroughly documented: https://devcenter.heroku.com/articles/platform-api-reference
I assume you've being downvoted by people who saw "fuck you" and stopped reading before getting to the ":)"
I made something similar to this for Diaspora: https://bitbucket.org/tubbo/replicator
Guess it's not needed anymore! :) Incidentally, if you for some reason want to bake this functionality into an existing gem, it may be easier to use Replicator's library than the Heroku API, since I had to read their source to understand how it all worked. That is, if for some reason you don't want to drop down to the command line and run `heroku fork` from Ruby.