#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3

    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
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,997
    Rep Power
    9397
    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.
    3. Either.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    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
  6. #4
  7. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,997
    Rep Power
    9397
    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.
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2002
    Location
    Seattle, U.S.A.
    Posts
    712
    Rep Power
    12
    Originally Posted by oo7ml
    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
    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.
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    FYI: You can't get the user's E-Mail address from the Twitter API.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    Thanks E-Oreo, so does that mean that i cannot email various notifications to the user if they have signed up with twitter

IMN logo majestic logo threadwatch logo seochat tools logo