Added preview property. Removed debugging intercepts. Logging post permalink on failed info fetch.

This commit is contained in:
2018-05-05 01:22:23 +02:00
parent ca3bdd717d
commit dd3be88122
4 changed files with 7 additions and 10 deletions

View File

@@ -6,8 +6,6 @@ const dissectLink = require('../dissectLink.js');
function curatePosts(posts, ignore) {
const processed = new Set();
console.log(ignore);
return posts.reduce((acc, post, index) => {
const host = dissectLink(post.url);
const ignoring = ignore ? ignore.find(prop => {
@@ -40,6 +38,7 @@ function curatePosts(posts, ignore) {
url: post.url,
datetime: new Date(post.created_utc * 1000),
subreddit: post.subreddit.display_name,
preview: post.preview ? post.preview.images.map(image => image.source) : null,
host
});
}, []);