ripunzel/src/methods/redditImage.js

22 lines
486 B
JavaScript

'use strict';
const util = require('util');
const config = require('config');
const mime = require('mime-types');
function redditImage(post) {
return Promise.resolve({
album: null,
items: [{
id: post.host.id || post.id,
url: post.url,
title: post.title,
datetime: post.datetime,
type: mime.lookup(post.url.split('/.')[0]),
original: post
}]
});
};
module.exports = redditImage;