What's a good way to integrate FB and Twitter into my commenting system (PHP)
There are so many options out there for integration.
At the moment I have comments that are posted on my articles, where a user types in their name and the comment. This is then sent to a moderation queue and displayed when approved.
I want to acheive this:
- Comment with facebook login (ie facebook account listed as the name w/ avatar)
- Comment with twitter login (ie twitter account name listed as the name w/ avatar)
- Push comment from my website to twitter and to facebook
I could go down a few paths as far as I know:
- Integrate with XFBML, which I don't like because I find it annoying to setup and messy.
- Integrate facebook comments system, although this can't push to twitter, or allow me to moderate comments from my backend (as far as I can tell i'd have to login under the facebook login for the dev ac开发者_C百科count to moderate the comment)
- Find a php class that does open auth and integrate with both face book and twitter at once
- find a pre-created php class
Anyone have a solution that will bias:
a. easy to integrate b. lightweight c. is free
Thanks for your suggestions in advance.
Okay Guys, I caved in and began writing my own simple class. I'm using XFBML but i'm not using the name spaced tag in my doctype, nor am I using xhtml. Those were the two things that bugged me about it. Not sure if this is correct but it is working for me in modern browsers.
If you are interested, here's my code. http://pastebin.com/qmgpmJYU
To use it, change your app key and secret (either in the init function or directly in the class).
Then call facebook::fetch(); just before the end of the body. you can then use facebook::user_info() to detect if a user is logged in, and pop in the login button if they are not.
精彩评论