Web Tag Reference dcm.Facebook - Gadreel/dcraft GitHub Wiki
TODO
- Alternate: Optional, defaults to Facebook. Name of the alternate account to use
- Count: number of items to list
TODO move configure, examples, details too specific page
<Catalog Name="Facebook">
<Settings NodeId="nodeid" AccessToken="token" CachePeriod="seconds between checks, default 900" />
</Catalog><dcm.Facebook />calls
S: dcmSocialMedia F: Facebook O: Feed
returns
[
{
By: 'from name (entry.from.name)',
ById: 'from name (entry.from.id',
Posted: 'time posted (entry.created_time)',
Message: 'posted message (entry.message)',
Picture: 'if a photo post, ulr to picture (entry.type == "photo") ? entry.full_picture : null)',
PostId: 'id of the post (entry.id.substring(entry.id.indexOf("_") + 1))'
},
... etc ...
]becomes
<div class="dcm-fb-listing">
<div class="dcm-fb-entry">
<div class="dcm-fb-header">
<div class="dcm-fb-icon">
<img src="https://graph.facebook.com/259192910805712/picture?type=small" style="width: 50px;">
</div>
<div class="dcm-fb-stamp">
<h3>Edinger Surgical Options</h3><i>Oct 18 at 11:44 am</i>
</div>
</div>
<div class="dcm-fb-body">
<p>Badger is ready to chase squirrels and play fetch 12 weeks after his right TPLO!</p>
</div>
<div class="dcm-fb-link">
<img src="https://scontent.xx.fbcdn.net/v/t1.0-9/14705620_1193053507419643_7383462936684562562_n.jpg?oh=33da27ee09054f2ec4725c77cfdddab4&oe=589B6419" style="max-width: 100%;"><p><a href="http://www.facebook.com/permalink.php?id=259192910805712&story_fbid=1193053507419643" target="_blank">View on Facebook - Share</a>
</div>
</div>
... etc ...
</div> var entry = $('<div class="fb-entry"></div>');
var hdr = $('<div class="fb-entry-hdr"></div>');
var info = $('<div class="fb-entry-info"></div>');
hdr.append('<div><img src="https://graph.facebook.com/' + item.ById + '/picture?type=small" style="width: 50px;" /></div>');
info.append('<h3>' + item.By + '</h3>');
info.append('<i>' + moment(item.Posted).format('MMM D \\a\\t h:mm a') + '</i>');
hdr.append(info);
entry.append(hdr);
if (item.Message)
entry.append('<p>' + item.Message + '</p>');
if (item.Picture)
entry.append('<img src="' + item.Picture + '" style="max-width: 100%;" />');
entry.append('<p><a href="http://www.facebook.com/permalink.php?id='
+ item.ById + '&story_fbid=' + item.PostId
+ '" target="_blank">View on Facebook - Share</a></p>');
prom = list.append(entry).promise();
if (pcnt >= 2)
break;
}