How can I post a C # web service on my facebook wall?

I tried a bunch of things and can't figure out how to post content on facebook wall from web service. Does anyone know if this is possible? It seems that the only way to publish content is to include a website login page, which is not what I would like to do. For twitter, I was able to read the message in less than 10 lines of code; just add username / password in request header and send message. I assume I am asking if there is an easy way to do this for facebook? Thanks in advance!

+5
source share
1 answer

You need to create an application on Facebook . Important settings when setting up on facebook:

Connect → Facebook Settings → Connect URL

This URL serves two purposes. First, this URL will be used as the base for your cross-domain link where you host the xd_receiver.htm file.

So, if your url is: http://yoursite.comthen you should have a url file http://yoursite.com/xd_receiver.htmthat allows the JavaScript Client Library for Facebook to run.

However, I highly recommend that you do not use your root URL. Select the subdirectory you are not linking to on your page. Something like this http://yoursite.com/ex/fbwill do nicely (I like it exfor "external", but it is completely subjective).

JavaScript. , , , .

→ →

" ".

, ( ):

  • API
  • URL- xd_receiver.htm

- , JavaScript FBML, ( ).

JavaScript API, xd_receiver.htm. ASP.NET, :

<%@ Page Language="C#"%>
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
  <script 
    src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/
      FeatureLoader.js.php" type="text/javascript"></script>
</head>

<body>
  <fb:login-button></fb:login-button>

  <hr>

  <fb:prompt-permission perms="offline_access">Click to grant offline 
    access permission.</fb:prompt-permission>
  <fb:prompt-permission perms="publish_stream">Click to grant publish 
    stream permission.</fb:prompt-permission>
  <fb:prompt-permission perms="read_stream">Click to grant read stream
    permission.</fb:prompt-permission>

  <input type="button" value="Get session key" onclick="
    document.all('apikey').value=FB.Facebook.apiClient.
    get_session().session_key;" />

  <input type="text" size="100px" id="apikey" />

  <script type="text/javascript">
  FB_RequireFeatures(["XFBML"], function () {
    FB.Facebook.init("API Key", "xd_receiver.htm URL");
  });
</script>

</body>

</html>

:

, , JavaScript fb.

, Facebook Connect. , , .

, fb:prompt-permission . , Facebook, .

, ( ), " ".

. offline_access, Facebook , .

:

  • API
  • ( )
  • , , ( URL- Facebook)

API Facebook .NET. Facebook Developer Toolkit.

Windows Forms , API . , , Windows Forms. .

. , . . ( Facebook) ( ). . , .

, :

  • API
  • , ,

, , API, , , ( , , ) - .

+4

All Articles