Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first commit. sorry, this is too larrge commit.
- Loading branch information
0 parents
commit f820821
Showing
19 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Some text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var oauth = require('oauth-revenge'); | ||
|
||
module.exports.index = function (req, res) { | ||
|
||
res.end('login'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports.index = function (req, res) { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var filters = module.exports; | ||
|
||
filters.index = function (req, res) { | ||
|
||
}; | ||
|
||
filters.show = function (req, res) { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var apis = module.exports; | ||
|
||
apis.authorize = require('./authorize'); | ||
apis.callback = require('./callback'); | ||
|
||
apis.statuses = require('./statuses'); | ||
apis.filters = require('./filters'); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports.set = function (config) { | ||
for (var key in config) { | ||
module.exports[key] = config[key]; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"LISTEN_PORT": "3000", | ||
"MONGODB": "mongodb://localhost/test_db" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var Keychain = require('./schemata').Keychain; | ||
|
||
var noop = function () {}; | ||
|
||
module.exports.init = function (name, callback) { | ||
name = name || 'default'; | ||
Keychain.findOne({ name: name }, function (err, keychains) { | ||
if (err) { throw err; } | ||
module.exports.key = keychains.key; | ||
module.exports.secret = keychains.secret; | ||
process.nextTick(callback || noop); | ||
}); | ||
}; | ||
|
||
module.exports.tie = function (name, key, secret) { | ||
var keychain = new Keychain({ | ||
name: name, | ||
key: key, | ||
secret: secret | ||
}); | ||
|
||
keychain.save(function (err) { | ||
if (err) { throw err; } | ||
}); | ||
}; | ||
|
||
module.exports.key = ''; | ||
module.exports.secret = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var config = require('./config.json'); | ||
|
||
var router = require('router').create(); | ||
var consumerkey = require('./consumerkey'); | ||
var apis = require('./apis'); | ||
var routes = require('./routes'); | ||
|
||
function init() { | ||
consumerkey.init(); | ||
routes.setup(router, apis); | ||
router.listen(config.LISTEN_PORT); | ||
} | ||
|
||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var Model = require('LazyBoy'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports.setup = function (router, apis) { | ||
router.get('/', function(req, res) { | ||
res.writeHead(200); | ||
var result = { message: 'Welcome to Read Fav Later!' }; | ||
res.end(JSON.stringify(result)); | ||
}); | ||
|
||
router.get('/authorize', apis.authorize.index); | ||
router.get('/callback', apis.callback.index); | ||
|
||
router.get('/statuses', apis.status.index); | ||
router.get('/statuses/{item}', apis.status.show); | ||
|
||
router.get('/filters', apis.filters.index); | ||
router.get('/filters/{filter}', apis.filters.index); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var config = require('./config.json'); | ||
|
||
var mongoose = require('mongoose'); | ||
mongoose.connect(config.MONGODB); | ||
var Schema = mongoose.Schema, | ||
ObjectId = Schema.ObjectId; | ||
|
||
var User = new Schema({ | ||
screen_name: String, | ||
twitter_uid: Number, | ||
token: String, | ||
accessToken: String | ||
}); | ||
module.exports.User = | ||
mongoose.model('User', User); | ||
|
||
var ConsumerKey = new Schema({ | ||
name: String, | ||
key: String, | ||
secret: String | ||
}); | ||
module.exports.Keychain = | ||
mongoose.model('ConsumerKey', ConsumerKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports.getSession = function (req) { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var consumerkey = require('./consumerkey'); | ||
|
||
consumerkey.tie( | ||
'default', | ||
'Q4ibSu9XhXvm21UVDbT4A', | ||
'9wXAUMrwZNaeVJlsf6twNtAAe9Y41XX876ZKsHtuU' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = (function () { | ||
function TwitterAuth () { | ||
|
||
} | ||
|
||
|
||
|
||
return TwitterAuth; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"author": "KOBA789 <kobahide789@gmail.com> (http://koba789.com/)", | ||
"name": "read_fav_later", | ||
"version": "0.0.0", | ||
"repository": { | ||
"url": "" | ||
}, | ||
"engines": { | ||
"node": "~0.6.6" | ||
}, | ||
"dependencies": { | ||
"mongoose": "*", | ||
"should": "*", | ||
"oauth-revenge": "*", | ||
"router": "*" | ||
}, | ||
"devDependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--require should | ||
--reporter spec | ||
--ui bdd | ||
--growl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### | ||
# ユーザー認証 | ||
# |