您可以使用Facebook Connect的“帐户链接”。
来自Facebook 开发者 wiki的 Python/Django 示例:
页:
def invite_friends(request):
#HTML escape function for invitation content.
from cgi import escape
facebook_uid = request.facebook.uid
# Convert the array of friends into a comma-delimeted string.
exclude_ids = ",".join([str(a) for a in request.facebook.friends.getAppUsers()])
# Prepare the invitation text that all invited users will receive.
content = """<fb:name uid="%s" firstnameonly="true" shownetwork="false"/> wants to invite you to play Online board games, <fb:req-choice url="%s" label="Put Online Gaming and Video Chat on your profile!"/>""" % (facebook_uid, request.facebook.get_add_url())
invitation_content = escape(content, True)
return render_to_response('facebook/invite_friends.fbml',
{'content': invitation_content, 'exclude_ids': exclude_ids })
模板:
<fb:request-form action="http://apps.facebook.com/livevideochat/?skipped=1"
method="POST" invite="true" type="Online Games"
content="{{ content }}">
<fb:multi-friend-selector max="20"
actiontext="Here are your friends who aren't using Online Games and Live Video Chat. Invite them to play Games Online today!"
showborder="true" rows="5" exclude_ids="{{ exclude_ids }}"> </fb:request-form>