Skip to content

Instantly share code, notes, and snippets.

'use strict';
const q = require('q'),
_ = require('lodash');
module.exports = async function() {
const self = this;
if (!self.facebookPageId) {
return q.reject(new Error(`Cannot get content - no facebook page ID for ${self.id}`));
}
await self.getFacebookTokens();
module.exports = function(attribute, start, end) {
let self = this;
let interval = {};
if (!end) {
// end = today
interval['end'] = parseInt(self[attribute]);
} else {
// Else, get end value: first value less than equal to end
return global.db.models.SocialUpdate.findOne({