First you'll need to get your PubNub API keys by visiting [http://admin.pubnub.com/](PubNub Account Dashboard)
curl http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.2.2.tgz > mongodb-osx-x86_64-2.2.2.tgz
tar xvfz mongodb-osx-x86_64-2.2.2.tgz
mkdir -p /data/db
mongodb-osx-x86_64-2.2.2/bin/mongod
mongodb-osx-x86_64-2.2.2/bin/mongo
Make sure you have Ruby 1.9.3 installed.
gem update --system
gem install pubnub
gem install mongo
gem install mongopipe ## MongoDB Pipe
gem install bson_ext
You may run the Pipe by issuing this simple command then follow the instructions that print out to test.
ruby <(curl http://goo.gl/bUlUh)
You can also download the Pipe file first then run it locally. This basically will save the Ruby source code file to your local hard drive and you can execute it anytime you need to.
curl http://goo.gl/bUlUh > pipe.rb
ruby ./pipe.rb
Follow the Output Instructions. That's it!
The following section only shows a sample insertable document that triggers replication broadcast to the map.
Next go back to your mongodb console and type the following commands:
use test
db.cap_collection.insert({ latlon : [ 1.5, 2.0 ] })