views:

117

answers:

5

Hello Guys

I have the following challenge at hand:

I have a fanpage for a apartment renting company. They would like to autoupdate their fanpage everytime a new apartment is added to the system.

The system is developed in C# ASP.NET 3.5.

I have downloaded the Facebook C# API From codeplex.

Have anyone done this, or know how to do it?

UPDATE:

So far I have tried the following:

        FacebookSession session = new Facebook.Session.ConnectSession(myKey,mySecretKey);

        Stream stream = new Stream(session);
        stream.Publish("Testing", null, null, null, 107010519323711);

I get a null reference Exception when I call Stream.Publish

A: 

You could publish new status in your pages by using Stream.publish method. Just pass the page id as uid parameter.

Ferry
I tried your suggestion and updated the thread.. can you help me to what I might be doign wrong?
BrinthHillerup
A: 
var _connectSession = new ConnectSession(API_KEY_HERE, FACEBOOK_SECRET_KEY_HERE);
if (_connectSession.IsConnected())
{
    var _facebookApi = new Api(_connectSession);
    _facebookApi.Stream.Publish("Your text here", null, null, string.Empty, USER_ID_OR_PAGE_ID_TO_TARGET);
}

That code should work. Keep in mind your application needs to have permission to write to the wall of your target, however. You can get the permission via a "Facebook Connect" dialog, or probably through some other means that is slipping my mind at the moment.

Nicholas H
A: 

I ended up with a work around here.. I made a RSS feed and fed it to an application called RSS Grafitti. Very simple and works well.

BrinthHillerup
A: 

The following link should help.

http://blog.theunical.com/facebook-integration/simple-5-steps-to-publish-on-a-facebook-wall-using-dotnet-c/

To allow whatever you want to do you will have to request extended permissions in the facebook connect javascript.

Marty Trenouth
+1  A: 

The easy answer is use the RSS Graffiti page app. It will update your page profile from an RSS feed that you create.