'use strict';
const R = require('ramda');
let createSocial = require('./social');
module.exports = tuple => {
const html = tuple[1];
const tweet = R.path(['html_content_item', 'tweet'], html);
const instagram = R.path(['html_content_item', 'instagram'], html);
if (!R.isNil(tweet)) {
return createSocial([{type: 'tweet', source_id: html.id}, tweet]);
}
Iif (!R.isNil(instagram)) {
return createSocial([{type: 'instagram', source_id: html.id}, instagram]);
}
const meta = {
"type": "html",
"id": html.id,
"lastModifiedDate": html.last_modified_date || html.updated_at
};
const attributes = {
"subType": "interactiveHTML",
"label": "Interactive Content"
};
const links = {
"url": "embeddedHTMLurlPlaceholder"
};
const data = {
"type":"embed",
"id": html.escenic_id,
attributes,
links
};
return [meta, {data}];
};
|