This is a sample Node.js application showing how to use Camayak's Content API to publish assignments to a Tumblr blog.
This sample application requires Node.js (version 0.10.x). To install Node.js see the Node.js Documentation.
The app is also configured to be deployed and run on Heroku . It can also be run locally. To deploy the app to Heroku, first follow the Heroku Quickstart to create an account, if you don't already have one, and to get the Heroku tools installed to your development machine.
You will also need a Tumblr account to publish content to.
Clone this repo to your development environment:
git clone https://github.com/camayak/contentapi-node-tumblr.git
Register the application with Heroku:
heroku create
Using the app name/url you got back from the heroku create
command, you'll need to update the
/controllers/index.js#get_tokens()
oauth callback url to point to your app on Heroku. Save and git commit
this change.
Deploy the application to Heroku:
git push heroku master
- Log into Tumblr
- Create a new Tumblr App:
- Go to http://www.tumblr.com/oauth/apps
- Click "Register Application"
- Fill out application data * "Default Callback URL" is required, but not directly used. You can enter the URL for your Heroku app deployed in an earlier step
- From the Tumblr app page, copy the Consumer Key and Consumer Secret into environment variables in Heroku:
*
heroku config:set TUMBLR_BLOG_NAME=<your tumblr blog name>
*heroku config:set TUMBLR_CONSUMER_KEY=<consumer key from tumblr>
*heroku config:set TUMBLR_CONSUMER_SECRET=<consumer secret from tumblr>
- In your browser, visit
http://<your heroku url>/get_tokens
. This should go through the oAuth process on Tumblr to authorize access to your account. In the end, your oAuth token and secret should be displayed in the web browser. Copy those into environment variables in Heroku: *heroku config:set TUMBLR_OAUTH_TOKEN=<oauth token from tumblr>
*heroku config:set TUMBLR_OAUTH_SECRET=<oauth secret from tumblr>
- Copy the API and optional shared secret into environment variables in Heroku:
heroku config:set CAMAYAK_API_KEY=<api_key from Camayak>
heroku config:set CAMAYAK_SHARED_SECRET=<shared secret from Camayak>
- Only if using a shared secret. Otherwise, don't create this environment variable.