<![CDATA[ Facebook "Wall" postings? - My Forums]]> https://forums.modx.com/thread/?thread=48995 <![CDATA[Re: Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286262 ]]> vanian Dec 02, 2010, 04:52 PM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286262 <![CDATA[Re: Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286261
Thanx Man...
]]>
imandic Oct 21, 2010, 03:00 PM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286261
<![CDATA[Re: Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286260 bunk58 Aug 19, 2010, 07:41 PM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286260 <![CDATA[Re: Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286259
PHP error debug
  Error: 	simplexml_load_file() [function.simplexml-load-file]: http://facebook.com/feeds/page.php?format=atom10&id=19110642979:1: parser error : Document is empty	 
  Error type/ Nr.: 	Warning - 2	 
  File: 	/home/username/public_html/manager/includes/document.parser.class.inc.php(770) : eval()'d code	 
  Line: 	9


I am editing this post as I think its my total lack of facebook knowledge that is the problem. The profile I have on facebook does not have any wall posting hence no output as I only set it up to get a key for the like buttons, what my plan was to show latest wall postings but these wont be mine so not sure if this can be done.

Thanks]]>
ian_m Aug 19, 2010, 02:54 PM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286259
<![CDATA[Re: Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286258
Works nicely.]]>
bunk58 Jul 15, 2010, 02:11 PM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286258
<![CDATA[Re: Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286257
Based on this work :
http://www.acornartwork.com/blog/2010/04/19/tutorial-facebook-rss-feed-parser-in-pure-php/
I came up with this snippet :

<?php
$url = 'http://facebook.com/feeds/page.php?format=atom10&id='.$id;
$maxnumber = $max;

/* The following line is absolutely necessary to read Facebook feeds. Facebook will not
recognize PHP as a browser and therefore won't fetch anything. So we define a browser here */

ini_set('user_agent','Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3');

$feed = simplexml_load_file($url);  //Load feed with simplexml

$fb_array = array();  //Initialize empty array to store statuses	
	 
foreach ( $feed->entry as $item ) {
	if ($maxnumber == 0) {
		break;
	} else {
               $desc = trim($item->title);
		if ($desc == '') {
			$desc = trim(strip_tags($item->content));
		}

                //Converts UTF-8 into ISO-8859-1 to solve special symbols issues
               $desc = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $desc);  //needed?

                //Get status update time
               $pubdate = strtotime($item->published);
               $propertime = gmdate('F jS Y, H:i', $pubdate);  //Customize this to your liking

               //Get link to update
               $linkback = $item->link['href'];
	       $pos = strpos($linkback, '://www.facebook.com/');
	       if ($pos === false) {
                 $linkback = 'http://www.facebook.com' . $linkback;
	       }

               //Store values in array
               $fb_item = array(
                      'desc' => $desc,
                      'date' => $propertime,
                      'link' => $linkback
               );
               array_push($fb_array, $fb_item);

               $maxnumber--;
          } 
     }

$output = '';

$output .= '<ul>';

foreach ($fb_array as $k => $v) {
  $output .= '  <li>';
  $output .= ' <b>' . $v['date'] . '</b>';
  $output .= '' . $v['desc'] . '';
  $output .= '  <a href="' . $v['link'] . '" target="_blank">Link</a>';
  $output .= '  </li>';
}

$output .= '</ul>';

return $output;
?>

(output has some empty quotes as I was messing around with styling and span tags ...)

which gets called in a doc template or sidebar chunk like this
[!fb_feed? &id=`19110642979` &max=`5` !]

(where the id number is the id of the facebook site you’re interested in - in this case that of MODx)

The result is a style-able and click-able list of the most recent postings the facebook owner has posted to their Wall (assuming I understand all this correctly). Note that this would only work for a public site.

FWIW, the wall data - including the most recent comment, comment count etc. - is also available from the facebook api code. But it seemed like overkill and this was was more simple for my needs.

Matt]]>
mconsidine Jul 15, 2010, 01:45 PM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286257
<![CDATA[Facebook &quot;Wall&quot; postings?]]> https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286256
I don’t use Facebook much but had a conversation with someone who wanted to be able to pull the latest five (say) postings that they made on their FB Wall into a sidebar on their website. Searching the forums I see the thread on MODx and FB Connect, but I’m not sure what that does for me. And unless I’m doing a poorly structured search, I don’t see much else.

Has anyone done this and if so could you elaborate?
TIA,
MattC]]>
mconsidine Jul 14, 2010, 07:46 AM https://forums.modx.com/thread/48995/facebook-wall-postings#dis-post-286256