20 lines
408 B
JavaScript
20 lines
408 B
JavaScript
'use strict';
|
|
|
|
const mime = require('mime');
|
|
|
|
async function redditImage(host, post) {
|
|
return {
|
|
album: null,
|
|
items: [{
|
|
id: host.id || post.id,
|
|
url: post.url,
|
|
title: post.title,
|
|
datetime: post.datetime,
|
|
type: mime.getType(post.url) || 'image/jpeg',
|
|
original: post,
|
|
}],
|
|
};
|
|
}
|
|
|
|
module.exports = redditImage;
|