<p>I am looking for a way to connect to Facebook by allowing the user to enter in their username and password and have our app connect to their account and get their contacts so that they can invite them to join their group on our site.  I have written a Facebook app before, but this is not an app as much as it is a connector so that they can invite all their friends or just some to the site we are working on.</p>

<p>I have seen several other sites do this and also connect to Yahoo, Gmail and Hotmail contacts.  I don't think they are using Facebook Connect to do this since it is so new, but they may be.  </p>

<p>Any solution in any language is fine as I can port whatever example to use C#.  I cannot find anything specifically on Google or Facebook to address this specific problem.  Any help is appreciated.  </p>

<p>I saw a first answer get removed that had suggested I might need to scrape the friends page.  The more I look around, this might be what I need to do.  Any other way I think will require the person to add it as an app.  I am wondering how a answer can get removed, maybe that user deleted it.</p>

[{'answer_id': 79571, 'author': 'Coda', 'author_id': 14807, 'author_profile': 'https://Stackoverflow.com/users/14807', 'pm_score': 2, 'selected': False, 'text': '<p>Seems like Facebook has an api for this. Check this blog here.</p>\n\n<p><a href="http://developers.facebook.com/news.php?blog=1&amp;story=73" rel="nofollow noreferrer">http://developers.facebook.com/news.php?blog=1&amp;story=73</a></p>\n'}, {'answer_id': 79593, 'author': 'Thomas', 'author_id': 14637, 'author_profile': 'https://Stackoverflow.com/users/14637', 'pm_score': 3, 'selected': False, 'text': "<p>Not answering the question but hopefully providing some insight...</p>\n\n<p>It's features like this that teach people that it is ok to enter their username and password for site A on a form from site B. This is most definitely not ok. Please do not make people think it is.</p>\n\n<p>But maybe the Facebook API allows you to circumvent this problem, by making people log into <em>Facebook itself</em> to give your app access. A slight but important difference.</p>\n"}, {'answer_id': 93582, 'author': 'Jim Zimmerman', 'author_id': 11196, 'author_profile': 'https://Stackoverflow.com/users/11196', 'pm_score': 2, 'selected': False, 'text': '<p>I looked up that it is alright to answer my own post, so here it is. </p>\n\n<p>It turns out that you will have to scrape the friends list which is not legal in facebook terms of use.  So we will not be doing this for our sites.  Here are a few articles that show what happens when you don\'t play by the rules.  Plaxo tested their scraping with Scoble and Facebook shut down Scobles account in January of this year.</p>\n\n<p><a href="http://scobleizer.com/2008/01/03/what-i-was-using-to-hit-facebook/" rel="nofollow noreferrer">http://scobleizer.com/2008/01/03/what-i-was-using-to-hit-facebook/</a></p>\n\n<p><a href="http://news.cnet.com/8301-13577_3-9839474-36.html" rel="nofollow noreferrer">http://news.cnet.com/8301-13577_3-9839474-36.html</a></p>\n'}, {'answer_id': 286351, 'author': 'Justin Yost', 'author_id': 657, 'author_profile': 'https://Stackoverflow.com/users/657', 'pm_score': 1, 'selected': False, 'text': '<p>Here is an open source PHP 5 tool to let you import contacts from both e-mail and some social networks including Facebook: <a href="http://openinviter.com/index.php" rel="nofollow noreferrer">OpenInviter</a> is an open source PHP class, written in PHP5, for importing contacts from most of the well-known e-mail providers &amp; social networks.</p>\n'}, {'answer_id': 1056322, 'author': 'Jim Zimmerman', 'author_id': 11196, 'author_profile': 'https://Stackoverflow.com/users/11196', 'pm_score': 3, 'selected': True, 'text': '<p>I asked this question awhile ago and before facebook connect was live and well.  The best way to really do this is using facebook connect.</p>\n\n<p><a href="http://developers.facebook.com/connect.php?tab=website" rel="nofollow noreferrer">http://developers.facebook.com/connect.php?tab=website</a></p>\n\n<p>I am currently using this on our live site and using the Facebook Developer Toolkit for .NET on Codeplex here: </p>\n\n<p><a href="http://www.codeplex.com/FacebookToolkit" rel="nofollow noreferrer">http://www.codeplex.com/FacebookToolkit</a></p>\n\n<p>Good luck!</p>\n'}, {'answer_id': 1606882, 'author': 'Jon Hadley', 'author_id': 161525, 'author_profile': 'https://Stackoverflow.com/users/161525', 'pm_score': 3, 'selected': False, 'text': '<p>You can use <a href="https://developers.facebook.com/docs/guides/web/" rel="nofollow noreferrer">Facebook Connect</a> \'Account Linking\'.</p>\n\n<p>Python/Django example from <a href="https://developers.facebook.com/docs/reference/fbml/request-form/" rel="nofollow noreferrer">Facebook developers wiki</a>:</p>\n\n<p><strong>Page:</strong></p>\n\n<pre class="lang-py prettyprint-override"><code>def invite_friends(request): \n    #HTML escape function for invitation content. \n    from cgi import escape \n    facebook_uid = request.facebook.uid \n\n    # Convert the array of friends into a comma-delimeted string. \n    exclude_ids = ",".join([str(a) for a in request.facebook.friends.getAppUsers()]) \n\n    # Prepare the invitation text that all invited users will receive. \n    content = """&lt;fb:name uid="%s" firstnameonly="true" shownetwork="false"/&gt;       wants to invite you to play Online board games, &lt;fb:req-choice url="%s" label="Put Online Gaming and Video Chat on your profile!"/&gt;""" % (facebook_uid, request.facebook.get_add_url()) \n\n    invitation_content = escape(content, True) \n    return render_to_response(\'facebook/invite_friends.fbml\',\n            {\'content\': invitation_content, \'exclude_ids\': exclude_ids })\n</code></pre>\n\n<p><strong>Template:</strong></p>\n\n<pre class="lang-html prettyprint-override"><code>&lt;fb:request-form action="http://apps.facebook.com/livevideochat/?skipped=1"     \n        method="POST" invite="true" type="Online Games" \n        content="{{ content }}"&gt;        \n\n    &lt;fb:multi-friend-selector max="20" \n        actiontext="Here are your friends who aren\'t using Online Games and Live Video Chat. Invite them to play Games Online today!" \n        showborder="true" rows="5" exclude_ids="{{ exclude_ids }}"&gt; &lt;/fb:request-form&gt;\n</code></pre>\n'}, {'answer_id': 6652394, 'author': 'John', 'author_id': 839154, 'author_profile': 'https://Stackoverflow.com/users/839154', 'pm_score': -1, 'selected': False, 'text': '<p>Just import them into Yahoo using FB Connect.  All better?  No screen scraping, no FB violations. Done.</p>\n'}]
['https://Stackoverflow.com/questions/79496', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11196/']