2019-11-01 03:22:36 +00:00
|
|
|
'use strict';
|
2018-04-17 22:18:04 +00:00
|
|
|
|
2021-12-17 01:04:25 +00:00
|
|
|
const mime = require('mime');
|
2018-05-01 00:56:56 +00:00
|
|
|
|
2019-11-01 03:22:36 +00:00
|
|
|
async function redditImage(host, post) {
|
|
|
|
return {
|
2018-04-17 22:18:04 +00:00
|
|
|
album: null,
|
|
|
|
items: [{
|
2019-11-01 03:22:36 +00:00
|
|
|
id: host.id || post.id,
|
2018-04-17 22:18:04 +00:00
|
|
|
url: post.url,
|
|
|
|
title: post.title,
|
|
|
|
datetime: post.datetime,
|
2021-12-17 01:04:25 +00:00
|
|
|
type: mime.getType(post.url) || 'image/jpeg',
|
2019-11-01 03:22:36 +00:00
|
|
|
original: post,
|
|
|
|
}],
|
|
|
|
};
|
|
|
|
}
|
2018-04-17 22:18:04 +00:00
|
|
|
|
2018-04-26 01:26:39 +00:00
|
|
|
module.exports = redditImage;
|