November 15th, 2012, 03:19 AM
Facebook & Twitter
Hi, i am in the process of finishing off my sign up form on my site.
I like most people here, would not use a social network to sign up to any website... i'd rather use an email address, HOWEVER, some people do use them.
So, i am just about to start integrating the Facebook and Twitter Sign Up APIs into my site, however i have a few questions.
1 - how do these work, what is the general process involved (what happens when they choose once of these methods)
2 - once a user signs up with one of the apis, is their info (such as first name, last name, email address) pulled from the Facebook or Twitter database, then saved in my database
3 - if i need to display some of the users details on my site (such as first name), where will the site be pulling the details from, my database or the social network database
Thanks in advance to any help you can give on any of the above questions
November 15th, 2012, 04:01 AM
1. OAuth. Look it up. Short version: your server gets a token from their site, redirects the user to a special page on their site, they log in, and the user is sent back to your server.
2. Not automatically. You have to use their APIs to get whatever information you want.
November 15th, 2012, 04:21 AM
Ok cool, thanks for your reply...
So, if i pull data from the social database to my site database, and the user updates their data on the social network, surely that would cause a problem... sorry just trying to see how these could be broken
November 15th, 2012, 05:16 AM
Yep, it could cause problems. Whether you cache data and how often you refresh it depends on your needs. Like if it's an occasional thing then you probably don't need to remember it, but for something like a name or email address you'll probably want to save yourself from the tons of API calls every time you need them.
November 15th, 2012, 10:56 AM
True, which may be a reason to just query the API to always have their most up to date information. You could also just have some sort of time limit, ie save their name to your database for 4 hours and after that point query the API to make sure the name is still up to date.
Originally Posted by oo7ml
November 15th, 2012, 05:42 PM
FYI: You can't get the user's E-Mail address from the Twitter API.
November 16th, 2012, 04:24 AM
Thanks E-Oreo, so does that mean that i cannot email various notifications to the user if they have signed up with twitter