Created
June 25, 2014 16:08
-
-
Save alanhoff/54764741bfc5302bd85b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Banco de dados (collections) | |
| users | |
| { | |
| _id : uc934uc93ug9fh3409f8 | |
| password : iuyg389274gf973g9f7 | |
| feeds : [ | |
| { | |
| url : 'http://feedlocodedoido.com.br/feed.rss', | |
| }, | |
| { | |
| url : 'http://feedlocodedoido.com.br/feed.atom', | |
| }, | |
| { | |
| url : 'http://feedlocodedoido.com.br/feed.xml', | |
| } | |
| ] | |
| } | |
| feeds | |
| user_id : uc934uc93ug9fh3409f8 | |
| title: String, | |
| author: String, | |
| link: String, | |
| content: String, | |
| published: { | |
| type: Date, | |
| default: Date.now | |
| }, | |
| feed: { | |
| name: String, | |
| source: String, | |
| link: String, | |
| }, | |
| updater.js | |
| (loop function(){ | |
| var User = mongoo.model('user'); | |
| User.find({}).exec(function(err, users){ | |
| if(err) | |
| throw err; | |
| (userLoop function(){ | |
| if(!users.length) | |
| return setTimeout(loop, 1500000); | |
| var user = users.shift(); | |
| pegar of feeds registrados em user.feeds e chamar o userLoop(); | |
| })() | |
| }); | |
| })(); | |
| /api/v1/feeds.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment