Results of my blog’s Facebook application
Two weeks ago I announced my first Facebook application, a simple RSS reader that streams my latest blog posts to Facebook profiles. It’s actually been quite effective so far. Facebook is sending me a modest amount of traffic and new people are adding the app every day.
Why you should use this for your youth group
I also copied the app and made another one to stream my youth group news, updates and announcements straight to my students’ profiles. There’s several advantages to using a tool like this:
- My students have direct access to youth group news right within Facebook.
- All their friends will also see the youth group news, a great outreach tool.
- Every update title automatically links back to our youth group site for more info.
- Students can invite their friends to add the application to their profiles, too, thus spreading the news even further.
- It’s one of the most ideal ways to communicate with students on their turf.
- The app only shows headlines and a summary of the content so it doesn’t overcrowd profile pages.
Two ways to get this Facebook app for yourself or your ministry
This is such a great communication tool that I want to show you all how you can have one, too. There’s two ways to do this:
1. Let me build and host it for you. I realize a lot of people feel lost when it comes to this kinda stuff, but still could greatly benefit from having the tool. So, I’m willing to create the app for you, host it, maintain it and everything! Just click here to find out more details.
2. Follow my instructions below and create one yourself.
Create one yourself
All the credit for these instructions goes to Falko Timme who wrote up a fantastic tutorial on how to set up a Facebook RSS feed for your blog. If you’re a little geeky and want to know how the app works and understand every step involved, his tutorial is very complete. It’s what I used to create my original Facebook application. My tutorial here is not an attempt to steal Falko’s thunder in any way, but to simplify the process for people who don’t administer their own servers or understand a Linux command line. My package below is also customized to offer some minor improvements to how the application handles RSS feeds.
Let’s get started.
In order for this to work, you must have access to a web host that uses PHP5. If you’re in the market for a good web host, I recommend Buyhttp.com. I use them for my youth group website and their service and support is fantastic. They don’t promise terabytes of space for a few bucks like other hosts because they don’t oversell their servers and they don’t offer cheap service like that. Instead of trying to make as much cash as possible, they focus on offering a high quality service that performs well. They offer hosting plans with PHP5, just make sure you ask for it when you sign up.
You must also have access to your hosting account’s cPanel to set up a cron job at the end of this tutorial.
The following screenshots are obviously from my own Facebook app and are only used as an example. Replace my data with your own.
Step 1
If you haven’t already registered at Facebook.com, you’ll obviously need to do so.
Step 2
Add the Developer Application to your profile, as described here.
Step 3
Once the Developer Application is added to your profile, visit it by clicking on “Developer” in the left side-bar. When the developer page opens, click on “Setup New Application” in the upper right-hand corner of the screen.
Step 4
A. Give your application a name. I’ve found that the shorter the name, the better. It’ll fit in your sidebar a lot nicer if it’s short. Unfortunately, mine isn’t. Also check the box under the name field saying you agree to the terms of the Facebook Platform.
B. Enter a valid email address where other developers and Facebook administrators can contact you concerning your application.
C. Enter the path to the folder on your web host that will contain your application files. You’ll get the files a bit later. For now, just make sure the folder exists on your host. IMPORTANT: The URL must end with a trailing slash (/).
D. The canvas page is the Facebook address for your application. This is where people will go to add your application to their profile and view your youth group/blog updates, so make it something easy to remember.
E. Make sure “Use FBLM” is selected.
F. Make sure “Website” is selected.
G. Make sure “Yes” is selected.
H. You can do this at a later time if you want. Just upload a 16×16 icon for your app that will display in the left side-bar for your application.
I. Fill in whatever you have from step D above.
J. Enter a brief description of your Facebook application.
K. This is the default text that will display on people’s profiles if something goes wrong with the application.
L. Make sure “Wide” is selected.
M. Again, enter your canvas page URL from step D above.
N. Click “Save.”
Step 5
Now you’ll see your API Key and your Secret for your application. Copy these down somewhere. You’ll need them later.
Step 6
Download this package and unzip it somewhere on your computer:
RSS Facebook Application Files
Step 7
Open the following files with a text editor, like Notepad for Windows or Taco HTML Edit for Mac. Do NOT use a word processor or anything that might format the text. Only replace the text I call for. Leave the apostrophes (‘), quotes (“), slashes (/) semi-colons (;) and commas (,) intact. Also make sure there are no extra spaces before or after the text you replace.
A. Open conf.php
- Replace API_KEY_HERE with your API Key.
- Replace SECRET_HERE with your Secret.
- Replace CALLBACK_URL_HERE with your callback URL from your Developer App settings. (Example, http://www.yourdomain.com/facebook/)
- Replace URL_TO_THE_RSS.PHP_FILE with the URL to where the rss.php file is on your host. (Example, http://www.yourdomain.com/facebook/rss.php)
- Replace YOUR_SITE_RSS_FEED_ADDRESS_HERE with you actual RSS feed. (Example, http://feeds.feedburner.com/timschmoyer)
- (Don’t change INFINITE_SESSION_KEY_HERE yet. We’ll change that later.)
- Save and close the file.
B. Open index.php
- Find YOUR_CANVAS_PAGE_URL_HERE on line 7 and replace it with your canvas page URL. Again, make sure you do NOT have two slashes in a row (//) before the “invite.php” part.
- Save and close the file.
C. Open invite.php
- Find YOTHGROUP_NAME on line 12 and replace it with the name of your youth group. (Example, “Power Surge Ministries”)
- Find CANVAS_URL_HERE on line 12 and replace it with your canvas URL. Be sure to leave the trailing backslash in place. (Example, “http://apps.facebook.com/timschmoyer”)
- Find SHORT_APP_NAME on line 12 and replace it with a short name for your app. About 15 characters or less should be fine.
- Find NAME_OF_YOUR_APP on line 13 and replace it with the name of your Facebook application.
- Save and close the file.
D. Open rss.php
- Find NUMBER_OF_POSTS_TO_SHOW on line 9 and replace it with the number of latest posts you want the app to display. I don’t recommend making this number any higher than 3. (Example, 2)
- Find APPLICATION_NAME on line 12 and replace it with the name of your Facebook application.
- Save and close the file.
Step 8
Now that all the files are updated and saved, upload the entire package to the callback folder on your web host so they’re accessible from your callback URL. (Example, upload everything to http://www.yourdomain.com/facebook/)
Step 9
With your FTP client, change the permissions of the folder magpie_cache to 777.
Step 10.
In your browser, type in your canvas page URL (http://apps.facebook.com/mygreatapp) and hit enter. You should be taken to a page that looks like this:
Click the big blue login button.
Step 11
Your next screen will look like this:
Make sure every box is selected and click the big blue add button.
Step 12
You will be redirected to your app’s page where your latest posts are displayed like this:
Check your profile page, too. You should see the latest posts displayed there, as well. Congratulations! You’re almost finished. Now all we have to do is set it up to automatically update with new content from your RSS feed.
Step 13
Log out of Facebook and clear out your browser’s cache, cookies, files, everything. This is absolutely necessary for the next step to work properly and to avoid headaches in the future, so do it right the first time. Trust me, I learned the hard way. If you don’t want to clear your browser’s files and cookies, use a different browser instead and make sure everything is cleaned out before going on to the next step. As far as your browser should know, it’s never been to Facebook.com or your website before.
Step 14
With the browser’s cache, cookies, temporary files and history cleared, type the address to the file get_infinite_key.php on your web host. (Example, http://www.yourdomain.com/facebook/get_infinite_key.php)
Step 15
When the Facebook login screen appears, enter your email address and password and make sure you check the box for, “Save my login info to avoid logging in to Facebook again to use this application.” Click the “Login” button to continue.
Step 16
A screen will appear that displays your “infinite key.” Copy this.
Step 17
Open conf.php, find INFINITE_SESSION_KEY_HERE on line 4 and replace it with your infinite key from step 16. Save the file, close it and upload it to your web host. Make sure it overwrites the existing file.
Step 18
Login to your hosting account’s cPanel and click on “Cron jobs.”
Step 19
On the next screen, click Advanced (Unix Style), and configure one of the lines to look like this:
In the first box (with “Minute” above it), type */30. In the Hour, Day, Month, Weekday boxes, type only an asterik (*). In the “Command” box, enter the absolute path to the cronjob.php file in your facebook application folder. If you do not know the absolute path to your hosting account, search your host’s knowledgebase or contact support and they’ll be happy to give it to you. (Example, /home/account_name/public_html/facebook/cronjob.php) Then click, “Commit Changes.” The cronjob.php file will now automatically check for new posts and refresh the Facebook app with the latest content every 30 minutes.
Step 20
Your Facebook application is now complete! Play around with it a little. Click the “Invite” tab at the top of your canvas page to invite people to add your application to their profiles. Facebook prevents applications from taxing their system too much by limiting the viral spread of applications. They do this by restricting app invitations to only 20 per person per day. So, you can use the invite tab to sent invites to 20 people today and then tomorrow send invites to 20 more people to join. Or, you can send everyone a link to your canvas page so they can add the app directly. There’s no restriction on how many people can add an application directly from your canvas page.
Step 21
Once you have at least 5 readers, your application is eligible for submission to the searchable Facebook application directory. To do this, click on “Developer” in your left side-bar and the click on the little link, “See My Apps” located in the “My Applications” box on the top right of the screen. Click “Submit Application” and fill out the requested info. In the description, be sure include a couple keywords people might use when searching for your app in the application directory. When finished, click the blue “Save” button and wait a day or two for your app to be reviewed.
That’s it! I hope this is not too overwhelming and trust it will help promote effective communication with the students in your ministry.
Again, if these instructions feel like they’re way over your head, feel free to let me build and host this application for you.
Troubleshooting
- Make sure you’re using a valid RSS feed. I ran into problems with one app because the feed wasn’t using the normal “Title” and “Description” meta tags. Odd, but apparently possible.
- If the application isn’t updating your profile page automatically with new content after 30 minutes, manually run your cronjob.php file from a browser (example, http://www.yourdomain.com/facebook/cronjob.php). If you get a bunch of gibberish text, go back and repeat steps 13-17 again. If you get a plain white screen and find that your Facebook app is now updated correctly, re-check your Cron Job settings in your cPanel (steps 18-19).
- If you get this error:
Parse error: syntax error, unexpected '{' in /home/rest_of_path/appinclude.php on line 10
find the solution in this comment below.
Posted on October 18, 2007