Facebook Channel - Non-Portlet

0
No votes yet

Hello,

I am posting my source code for our Facebook Channel. I know Duke has a portlet, but my java is crappy, and I don't have time to develop portlets at the moment. This Channel is PHP/MySql. It will involve a cpip, so you might want to brush up on that. Included in the zip are instructions, a screen shot, the sql for the database, and all files needed to deploy. All you need are a CPIP, facebook app, and an apache/mysql/php server. That's it.

Oh , in addition, ps, also, Please let me know if you downloaded it, and had any issues, or just plain didn't like it. Thanks.

Regards,

Kyle

--UPDATE--

Attached revised code and instructions.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cool.

This looks great. Could you include your configman properties for the cpip channel?

CPIP config

es.facebookcpip.configattempts=5
es.facebookcpip.domain=http://YOURSERVER.school.edu
es.facebookcpip.configsleeptime=30000
es.facebookcpip.configURL=http://YOURSERVER.school.edu/[LOCATION OF CPIP HTML FILE]

CPIP Credentials

We thought about doing something like this a while back, but we got hung up on how to create an SSO for external credentials. Are you just providing students with a regular login page for their Facebook account? If so, are you storing these credentials anywhere, or do they have to login each time they log back into the portal?

How it works

Basically, a student must "initialize" the channel. It takes them to a facebook login for the application. They MUST click on the "let this application remember me" box for this to work. There is a callback that is performed upon successful login that stores the authentication key given to me from facebook. I store that in a database along with a session id and their luminis username. I don't store their facebook user id or password. The next time they log into the portal, the channel pulls their auth_gen key and uses the facebook api to log them in automatically. After the initial login, there is no need to login again, as long as they clicked that box at first login. This may seem a little confusing, but give it a try and see what happens.

The pains of GCF

Before I go through the pains of making a GCF connector, is there a way that I can verify that the Facebook application is working correctly? I have deployed it on a LAMP stack that we have, and I am at a page reading "You have not yet initialized this channel..."

When I clicked the login link, it asked me if I wanted to add my application to the list of applications that can access my account information, etc, etc. However, when I click the Javascript link again, the popup appears, then disappears. It looks to be accessing /facebook/cb/?auth_token=#####

When going directly to this link, I see the page "Something bad happened......."

Check Session Variables

Since this is supposed to work within a luminis session, the $_SESSION['username'] variable is not assigned when going to the /facebook/cb/index.php file, which throws an error. To hand "initialize", grab the auth_token from url. Go to your database and insert a row with the auth_token in the auth_gen field. Make sure you have your luminis username in there as well. I have not gotten around to immutable ids, primarily because this is supposed to work with lum iii. You can always email me at the address in the zip file if you have any questions. Hope this helps.

What exactly does it do?

Hi, I'm interested in implementing anything that will make the portal more useful.

What exactly does your Facebook channel do? If it's not too much to ask, have you got a screenshot kicking around?

Thanks,

Jeff

What it does...

Ok, i uploaded the screen shot. Basically it allows the student to change their Facebook status, view friend requests, group invites, upcoming events, friends that are online, upcoming birthdays, and any new notifications they have. The feedback from my test group has been favorable so far.

Having problems with sql script

When I run facebook.sql, it seems to bomb out.

ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right synt
ax to use near 'DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci' at line
ERROR 1049: Unknown database '`facebook`'
ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right synt
ax to use near 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=17' at line 6
ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right synt
ax to use near 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=40' at line 9

Do I need these CHARSET lines in there? Sorry if its a dumb question I am new to mysql!

Version?

What version of MySQL are you using? The script was generated for 5.0.17.