Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mashery/iodocs
...
head fork: wurlinc/iodocs
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 18 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
1  .gitignore
@@ -1,5 +1,4 @@
.DS_Store
node_modules/*
-config.json
logs/*
pids/*
View
1  Procfile
@@ -0,0 +1 @@
+web: node app.js
View
31 app.js
@@ -49,8 +49,26 @@ try {
// Redis connection
//
var defaultDB = '0';
-var db = redis.createClient(config.redis.port, config.redis.host);
-db.auth(config.redis.password);
+
+var redisConfig = {};
+if (process.env.REDISTOGO_URL) {
+ var rtg = require("url").parse(process.env.REDISTOGO_URL);
+ console.log("RedisToGo:" + util.inspect(rtg));
+ redisConfig.port = rtg.port;
+ redisConfig.hostname = rtg.hostname;
+ redisConfig.password = rtg.auth.split(":")[1];
+// db = require("redis").createClient(rtg.port, rtg.hostname);
+// db.auth(rtg.auth.split(":")[1]);
+} else {
+ redisConfig.port = config.redis.port
+ redisConfig.hostname = config.redis.host;
+ redisConfig.password = config.redis.password;
+// db = redis.createClient(config.redis.port, config.redis.host);
+// db.auth(config.redis.password);
+}
+
+var db = redis.createClient(redisConfig.port, redisConfig.hostname);
+db.auth(redisConfig.password);
// Select our DB
db.on("connect", function() {
@@ -92,9 +110,9 @@ app.configure(function() {
app.use(express.session({
secret: config.sessionSecret,
store: new RedisStore({
- 'host': config.redis.host,
- 'port': config.redis.port,
- 'pass': config.redis.password,
+ 'host': redisConfig.hostname,
+ 'port': redisConfig.port,
+ 'pass': redisConfig.password,
'maxAge': 1209600000
})
}));
@@ -632,6 +650,7 @@ app.get('/:api([^\.]+)', function(req, res) {
// Only listen on $ node app.js
if (!module.parent) {
- app.listen(config.port, config.address);
+ var port = process.env.PORT || config.port || '3000';
+ app.listen(port, config.address);
console.log("Express server listening on port %d", app.address().port);
}
View
12 config.json
@@ -0,0 +1,12 @@
+{
+ "title" : "Wurl API Live Documentation",
+ "debug" : false,
+ "port" : "3000",
+ "sessionSecret" : "12345",
+ "redis" : {
+ "host" : "localhost",
+ "port" : 6379,
+ "password" : "",
+ "database" : "0"
+ }
+}
View
5 package.json
@@ -27,11 +27,12 @@
"jade": "0.13",
"oauth": "0.9.3",
"querystring": "0.0.1",
- "redis": "0.6.6"
+ "redis": "0.6.6",
+ "redis-url":"0.0.1"
},
"devDependencies": {},
"main": "index",
"engines": {
"node": ">= 0.4.0"
}
-}
+}
View
50 public/data/apiconfig.json
@@ -1,46 +1,18 @@
{
- "klout": {
- "name": "Klout API",
- "protocol": "http",
- "baseURL": "api.klout.com",
- "publicPath": "/1",
+ "wurlv1": {
+ "name": "Wurl API version 1",
+ "protocol": "https",
+ "baseURL": "api.wurl.com",
+ "publicPath": "/api",
"auth": "key",
- "keyParam": "key"
- },
- "fanfeedr": {
- "name": "FanFeedr Sports Basic API",
- "protocol": "http",
- "baseURL": "ffapi.fanfeedr.com",
- "publicPath": "",
- "auth": "key",
- "keyParam": "api_key"
+ "keyParam": "apikey"
},
- "alibris": {
- "name": "Alibris API",
- "protocol": "http",
- "baseURL": "api.alibris.com",
- "publicPath": "/v1/public",
+ "wurlv2": {
+ "name": "Wurl API version 2 (Coming Soon)",
+ "protocol": "https",
+ "baseURL": "api.wurl.com",
+ "publicPath": "/v2",
"auth": "key",
"keyParam": "apikey"
- },
- "usatoday": {
- "name": "USA TODAY Census API",
- "protocol": "http",
- "baseURL": "api.usatoday.com",
- "publicPath": "/open",
- "auth": "key",
- "keyParam": "api_key"
- },
- "simplegeo": {
- "name": "SimpleGeo",
- "protocol": "http",
- "baseURL": "api.simplegeo.com",
- "publicPath": "",
- "auth": "oauth",
- "oauth": {
- "type": "two-legged",
- "version": "1.0",
- "crypt": "HMAC-SHA1"
- }
}
}
View
171 public/data/wurlv1.json
@@ -0,0 +1,171 @@
+{
+ "endpoints": [
+ {
+ "name": "Search",
+ "methods": [
+ {
+ "MethodName":"search",
+ "Synopsis":"Search for shows or videos",
+ "HTTPMethod":"GET",
+ "URI":"/search",
+ "RequiresOAuth": "N",
+ "parameters":[
+ {
+ "Name":"searchTerms",
+ "Required": "Y",
+ "Type":"string",
+ "Description":"The keyword terms to search for."
+ },
+ {
+ "Name":"startPage",
+ "Required":"N",
+ "Type": "integer",
+ "Default":"",
+ "Description":"The page of results to return. Defaults to '1'. May not be honored if there isn't enough pages of results."
+ },
+ {
+ "Name":"perPage",
+ "Required":"N",
+ "Type": "integer",
+ "Default":"",
+ "Description":"The number of search results per page of results. Defaults is 20. Maximum is limited to 1000."
+ },
+ {
+ "Name":"order",
+ "Required":"N",
+ "Type": "enumerated",
+ "EnumeratedList":[
+ "metachannels_rank",
+ "keyword",
+ "recency"
+ ],
+ "Description":"The order to return results in. If not specified, uses metachannels_rank."
+ },
+ {
+ "Name":"types",
+ "Required":"N",
+ "Type": "enumerated",
+ "EnumeratedList":[
+ "shows",
+ "episodes"
+ ],
+ "Description":"The type of search results items to restrict the search to. Default is shows."
+ },
+ {
+ "Name":"fields",
+ "Required": "N",
+ "Type":"string",
+ "Description":"Restrict the search to just the fields specified. Supported fields are: 'title', 'description', 'keywords', 'show_title'. If multiple fields are specified separate by a comma."
+ },
+ {
+ "Name":"format",
+ "Required": "N",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "json",
+ "xml"
+ ],
+ "Description":"The response format"
+ }
+
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Shows",
+ "methods": [
+ {
+ "MethodName":"show",
+ "Synopsis":"Retreive a specific show",
+ "HTTPMethod":"GET",
+ "URI":"/shows/:id",
+ "RequiresOAuth": "N",
+ "parameters":[
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Type":"integer",
+ "Default":"",
+ "Description": "The identifier of the show"
+ },
+ {
+ "Name":"startPage",
+ "Required":"N",
+ "Type": "integer",
+ "Default":"",
+ "Description":"The page of video results to return. Defaults to '1'. May not be honored if there isn't enough pages of results."
+ },
+ {
+ "Name":"perPage",
+ "Required":"N",
+ "Type": "integer",
+ "Default":"",
+ "Description":"The number of videos per page. Default is 5."
+ },
+ {
+ "Name":"format",
+ "Required": "N",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "json",
+ "xml"
+ ],
+ "Description":"The response format."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Genres",
+ "methods": [
+ {
+ "MethodName":"genres",
+ "Synopsis":"Retreive all genres",
+ "HTTPMethod":"GET",
+ "URI":"/genres",
+ "RequiresOAuth": "N",
+ "parameters":[
+ {
+ "Name":"format",
+ "Required": "N",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "json",
+ "xml"
+ ],
+ "Description":"The response format."
+ }
+ ]
+ },
+ {
+ "MethodName":"genre",
+ "Synopsis":"Retrieve a specific genre",
+ "HTTPMethod":"GET",
+ "URI":"/genres/:id",
+ "RequiresOAuth":"N",
+ "parameters":[
+ {
+ "Name":"id",
+ "Required":"Y",
+ "Type":"integer",
+ "Default":"",
+ "Description": "The 'slug' of the genre. 'arts', 'business', etc."
+ },
+ {
+ "Name":"format",
+ "Required": "N",
+ "Type":"enumerated",
+ "EnumeratedList":[
+ "json",
+ "xml"
+ ],
+ "Description":"The response format."
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
View
4 public/data/wurlv2.json
@@ -0,0 +1,4 @@
+{
+ "endpoints": [
+ ]
+}
View
2  views/layout.jade
@@ -13,7 +13,7 @@ html
!{body}
div(id='io-footer')
div(class='f-left') ©
- a(href='http://mashery.com/io') Mashery, Inc.
+ a(href='http://wurl.com') Wurl, Inc.
div(class='f-right') Powered by
a(href='https://github.com/mashery/iodocs') I/O Docs
script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js')
View
2  views/listAPIs.jade
@@ -1,6 +1,6 @@
h1=title
-h2 Choose an API
+h2 Choose an API version
ul
- for (var api in apiInfo)

No commit comments for this range

Something went wrong with that request. Please try again.