-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from humphd/bullmq
A very basic queue to allow downloading feeds
- Loading branch information
Showing
6 changed files
with
429 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,10 @@ | ||
# A simple list of feeds for initial testing, copied from | ||
# https://wiki.cdot.senecacollege.ca/wiki/Planet_CDOT_Feed_List | ||
https://neilong31.wordpress.com/feed/ | ||
http://ajhooper.blogspot.com/feeds/posts/default | ||
http://ljubomirgorscak.blogspot.com/feeds/posts/default | ||
http://nashutzu.blogspot.com/feeds/posts/default | ||
http://nadavid.blogspot.com/feeds/posts/default | ||
http://gkrilov.blogspot.com/feeds/posts/default | ||
http://KrazyDre.blogspot.com/feeds/posts/default?alt=rss | ||
http://dcucereavii.blogspot.com/feeds/posts/default?alt=rss |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
{ | ||
"name": "telescope", | ||
"version": "0.0.1", | ||
"description": "A tool for tracking blogs in orbit around Seneca's open source involvement", | ||
"scripts": { | ||
"test": "echo \"TODO!\" && exit 1", | ||
"start": "node src" | ||
}, | ||
"repository": "Seneca-CDOT/telescope", | ||
"license": "BSD-2-Clause", | ||
"bugs": { | ||
"url": "https://github.com/Seneca-CDOT/telescope/issues" | ||
}, | ||
"homepage": "https://github.com/Seneca-CDOT/telescope#readme", | ||
"dependencies": { | ||
"bent": "^7.0.2", | ||
"bull": "^3.11.0" | ||
} | ||
} |
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 @@ | ||
const Bull = require('bull'); | ||
const queue = new Bull('feed-queue'); | ||
|
||
module.exports = queue; |
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 @@ | ||
const feedQueue = require('./feed-queue'); | ||
const bent = require('bent'); | ||
const request = bent('string'); | ||
|
||
exports.start = function() { | ||
// Start processing jobs from the feed queue... | ||
feedQueue.process(async (job) => { | ||
const { url } = job.data; | ||
console.log(`Processing job - ${url}`); | ||
|
||
// For now, just get the feed data and dump to the console | ||
return request(url).then(data => console.log(data + '\n\n')) | ||
}); | ||
}; |
Oops, something went wrong.