|
|
@ -28,7 +28,7 @@ module.exports = function createPastebinComScraper(options = {}) {
|
|
|
|
queue.define("fetchPaste", (task) => {
|
|
|
|
queue.define("fetchPaste", (task) => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
debug(`Fetching paste ID ${task.pasteKey}...`)
|
|
|
|
debug(`Fetching paste ID ${task.pasteKey}...`)
|
|
|
|
return bhttp.get(`http://pastebin.com/api_scrape_item.php?i=${task.pasteKey}`);
|
|
|
|
return bhttp.get(`https://pastebin.com/api_scrape_item.php?i=${task.pasteKey}`);
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|
if (response.statusCode !== 200) {
|
|
|
|
if (response.statusCode !== 200) {
|
|
|
|
// FIXME: Retry!
|
|
|
|
// FIXME: Retry!
|
|
|
@ -55,7 +55,7 @@ module.exports = function createPastebinComScraper(options = {}) {
|
|
|
|
start: function startScraper() {
|
|
|
|
start: function startScraper() {
|
|
|
|
loop = promiseSetInterval(() => {
|
|
|
|
loop = promiseSetInterval(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return bhttp.get(`http://pastebin.com/api_scraping.php?limit=${defaultValue(options.listLimit, 100)}`, {
|
|
|
|
return bhttp.get(`https://pastebin.com/api_scraping.php?limit=${defaultValue(options.listLimit, 100)}`, {
|
|
|
|
noDecode: true /* Because Pastebin.com errors aren't JSON... */
|
|
|
|
noDecode: true /* Because Pastebin.com errors aren't JSON... */
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).then((response) => {
|
|
|
|
}).then((response) => {
|
|
|
|