Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds error handling

  • Loading branch information...
commit 2abd7bd2a4d87fcc4a25c031642d64f8bd69d40a 1 parent e91f634
Bob Corsaro dokipen authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 README.rst
6 README.rst
View
@@ -33,11 +33,13 @@ Getting Started
Here are some examples *hint* replace xxxxxxxxxxx with real key::
+ var EMBEDLY_KEY = 'xxxxxxxxxxxxxx'
+
var embedly = require('embedly')
, require_either = embedly.utils.require_either
, util = require_either('util', 'utils')
, Api = embedly.Api
- , api = new Api({user_agent: 'Mozilla/5.0 (compatible; myapp/1.0; u@my.com)', key: 'xxxxxxxxxxxxx'})
+ , api = new Api({user_agent: 'Mozilla/5.0 (compatible; myapp/1.0; u@my.com)', key: EMBEDLY_KEY})
// call single url
@@ -66,7 +68,7 @@ Here are some examples *hint* replace xxxxxxxxxxx with real key::
console.error(e)
}).start()
- api = new Api({key: 'xxxxxxxxxxxx', user_agent: 'Mozilla/5.0 (compatible; myapp/1.0; u@my.com)'})
+ api = new Api({key: EMBEDLY_KEY, user_agent: 'Mozilla/5.0 (compatible; myapp/1.0; u@my.com)'})
api.preview({url: 'http://www.guardian.co.uk/media/2011/jan/21/andy-coulson-phone-hacking-statement'}).
on('complete', function(objs) {
console.log('--------------------------------------------------------------')
Please sign in to comment.
Something went wrong with that request. Please try again.