SunnysideUp\ShareThis\Model\FacebookFeedItem
FROM: http://www.acornartwork.com/blog/2010/04/19/tutorial-facebook-rss-feed-parser-in-pure-php/ EXAMPLE: //Run the function with the url and a number as arguments $fb = new TheFaceBook_communicator(); $dos = $fb->fetchFBFeed('http://facebook.com/feeds/status.php?id=xxxxxx&viewer=xxxxxx&key=xxxxx&format=rss20', 3); //Print Facebook status updates echo '<ul class="fb-updates">'; foreach ($dos as $do) { echo '<li>'; echo '<span class="update">' .$do->Description. '</span>'; echo '<span class="date">' .$do->Date. '</span>'; echo '<span class="link"><a href="' .$do->Link. '">more</a></span>'; echo '</li>'; } echo '</ul>';
SEE README on getting facebook URL for RSS Feed.
Synopsis
class FacebookFeedItem
extends DataObject
{
- // members
- private static string $table_name = 'FacebookFeedItem';
- private static array $db = ;
- private static array $summary_fields = ;
- private static array $has_one = ;
- private static array $indexes = ;
- private static array $casting = ;
- private static array $searchable_fields = ;
- private static string $singular_name = 'Facebook Item';
- private static string $plural_name = 'Facebook Items';
- private static string $default_sort = '"Created" DESC';
- // methods
- public boolean canCreate()
- public boolean canView()
- public boolean canEdit()
- public boolean canDelete()
- public string i18n_singular_name()
- public string i18n_plural_name()
- public void onBeforeWrite()
- public FieldList getCMSFields()
- public void KeepOnTopNice()
- public void HideNice()
- public string getFacebookPostLink()
- public bool IsLinkBackToSite()
- public strring SmartLink()
- public void fbpostExists()
- public boolean canRemove()
- public string RemoveLink()
- protected void createDescriptionWithShortLinks()
- protected string replaceLinksWithProperOnes()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $casting — array
- $db — array
- $default_sort — string
- $has_one — array
- $indexes — array
- $plural_name — string
- $searchable_fields — array
- $singular_name — string
- $summary_fields — array
- $table_name — string
Methods
protected
public
- HideNice() — HideNice
- IsLinkBackToSite() — is the link attached to the FB post a link back to this site?
- KeepOnTopNice() — KeepOnTopNice
- RemoveLink() — Remove the link
- SmartLink() — returns a link back to the same site if that is what the FB post links to or a link to FB if it ultimately links to third-party site.
- canCreate()
- canDelete()
- canEdit()
- canRemove()
- canView()
- fbpostExists() — Check whether Facebook post exists
- getCMSFields()
- getFacebookPostLink()
- i18n_plural_name()
- i18n_singular_name()
- onBeforeWrite()