Until recently you could import your facebook news feed using a json feed available through the Facebook Graph API without needing to set up an oAuth token. Unfortunately, facebook pulled the rug out from under us all when they started requiring oAuth tokens on the basic graph API. This caused many sites to start receiving the following error: "OAuthException An access token is required to request this resource." Pretty annoying. I was ready to jump through facebook's hoops and create a facebook app dedicated to providing access to the news feed when I realized each page has an rss feed built right in. IMO it's not AS good as the data from the graph API but for most situations it will get the job done.
Posts Tagged ‘php’
Get latest status from facebook fan pages in PHP (part 2: multiple entries)
This is a very simple way to get the latest posts from a facebook fan page. I previously wrote a VERY simple guide that just returns the latest single post (as this is all people want a lot of the time). If that is what you are looking for read this guide instead. By popular demand I created this additional tutorial that will show you how to display the latest 10 posts and display them with date. Also, this code will filter out things posted on your wall by other people and display ONLY things the owner of the facebook page posted.
PHP isset vs empty
A very common mistake when first getting in to PHP is to think that isset() and empty() can be used as each others inverse. This is VERY far from the truth and can cause major problems in an application. In this quick article I will explore the differences between isset and empty in PHP
WordPress upgrade Call to a member function add_rewrite_tag() on a non-object
This is just a quick post for anyone who got the following error (as I did on a couple sites) when upgrading WordPress to 3.0+
Fatal error: Call to a member function add_rewrite_tag() on a non-object in … /wp-includes/taxonomy.php on line 289
Easiest way to get the latest status from facebook fan pages in PHP
So, quite often companies what to show their latest post from their facebook fan page on their website. This should be really simple right. Well it is. However, it seems like most of the world wants to REALLY over complicate it. I searched for this forever and people didn't seem to understand: I don't want facebook connect. I don't need to log in a user. I shouldn't need to load the facebook sdk. I shouldn't need to create a facebook app. There has to be a better way. I thought to myself it's SUPER easy on twitter there has to be something similar for facebook and of course there is.
Load latest twitter tweet in 1 line of PHP code
If all you're looking to do is load your latest tweet in the simplest way possible this is the function you need. Luckily Twitter formats all of the latest posts into simple RSS feeds which makes it SUPER easy to just go and get them. It honestly doesn't get any easier than this. Read the rest of this entry »
Force PHP to show all errors or save them to a log for troubleshooting
Most servers are set to suppress PHP errors which can leave you guessing why something isn't working and make troubleshooting code almost impossible. This is especially frustrating when you install a 3rd party module with errors. Luckily forcing PHP to display errors is very easy.
Read the rest of this entry »