TinyPortal

Development => Resources => Topic started by: Xtreme4U2NV on October 31, 2013, 09:35:34 PM

Title: Is there a way to make a block that shows my current facebook wall posts?
Post by: Xtreme4U2NV on October 31, 2013, 09:35:34 PM
Link to my forum: http://www.rcacres.ca
SMF version: SMF 2.0.6
TP version: 1.107
Default Forum Language: English
Theme name and version: CZ Ink
Browser Name and Version: Google Chrome and Firefox
Mods installed: just TinyPortal
Related Error messages: tinyportal XML error: not well-formed (invalid token) at line 9

I tried making a RSS block with the Facebook RSS of my page and I got the above error.

I work with a race track.  Some older fellows don't use Facebook and would like notifications.  Facebook is where everything is posted first.  So I was aiming to create a block that had the posts from our Facebook page so those not on the Facebook bandwagon can stay in the loop.

And to avoid being a nuisance, I did try to search and couldn't find an answer.

Your help is great appreciated.
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: IchBin on November 01, 2013, 08:46:07 PM
What's the URL for the RSS feed? Have you tested the URL in an RSS validator to see if the code being output in the feed is valid?
http://validator.w3.org/feed/check.cgi

Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: Xtreme4U2NV on November 01, 2013, 08:53:58 PM
Quote from: IchBin™ on November 01, 2013, 08:46:07 PM
What's the URL for the RSS feed? Have you tested the URL in an RSS validator to see if the code being output in the feed is valid?
http://validator.w3.org/feed/check.cgi

Just tested with that link, it says "Congratulations, this is a valid RSS feed"

It did say this right below that though"

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
line 14, column 37: Email address is missing real name [help]
    <webMaster>webmaster@facebook.com</webMaster>
                                     ^
line 696, column 2: Missing atom:link with rel="self" [help]
  </channel>
  ^
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: IchBin on November 01, 2013, 09:24:00 PM
Where are you getting the feed URL? I don't see that facebook provides an RSS feed URL.
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: Xtreme4U2NV on November 01, 2013, 09:26:52 PM
Quote from: IchBin™ on November 01, 2013, 09:24:00 PM
Where are you getting the feed URL? I don't see that facebook provides an RSS feed URL.

https://www.facebook.com/help/212445198787494/

There is a link to the Notifications page, which then provides the RSS url
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: IchBin on November 02, 2013, 04:39:47 AM
It would seem that Facebook RSS feeds have to have a cetain user_agent in order to work through the PHP rss functions. Open your Sources/TPSubs.php file and search for the TPparseRSS() function somewhere around line 2000.

Right after the global line add this and see if it works.
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: Xtreme4U2NV on November 03, 2013, 02:34:10 AM
Quote from: IchBin™ on November 02, 2013, 04:39:47 AM
It would seem that Facebook RSS feeds have to have a cetain user_agent in order to work through the PHP rss functions. Open your Sources/TPSubs.php file and search for the TPparseRSS() function somewhere around line 2000.

Right after the global line add this and see if it works.
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');

That seemed to work fantastic, but is there a way to limit the amount of posts that the RSS puts up?
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: IchBin on November 03, 2013, 11:39:55 PM
Currently the code only reads what is in the feed. No way to limit the feed I'm afraid. If you want to do stuff like that, you'll have to look into third party site that can process your feed before you hand it off for TP to parse.

Somethine like www.rss2html.com

There are a handful of sites out there that will do this for you.
Title: Re: Is there a way to make a block that shows my current facebook wall posts?
Post by: WillyP on November 11, 2013, 10:34:36 PM
Facebook offers many other ways to integrate with your site and siphon off visitors... have you looked at the developer site? For example, Activity Feed - Facebook Developers (https://developers.facebook.com/docs/plugins/activity/).