Mono Support Any way to connect my blog with facebook ?  

Viewed 55023 time(s), 5 post(s), 1/22/2013 8:25:59 PM - by super
1/22/2013 8:25:59 PM
6018 Reputation 709 Total posts

Any way to connect my blog with facebook ? so that whatever is being posted on the blog posted automatically on facebook too ?

1
1/23/2013 9:31:46 AM
3016 Reputation 428 Total posts

Hi,

currently that is not automatically implemented, but you can use MonoX share provider to achieve functionlity you need.

Regards.

2
1/23/2013 4:48:42 PM
6018 Reputation 709 Total posts

I know about sharing but that is not feasible for each n every post since it is very time consuming. It would be great if this feature is added in monox.

3
1/23/2013 5:21:36 PM
2218 Reputation 300 Total posts

Hello super,

The following feature is not supported directly by MonoX and requires custom coding. We have developed similar features for custom projects however.

First please make sure that you are following these guidelines to create a custom MonoX based project.

Next you need to select an SDK you would like to use for your Facebook integration, we have used Facebook C# SDK.  One of my coworkers wrote an article on this subject and you can read it here. The article will demonstrate you how to setup your own Facebook application and how to fetch users profile. This is a sample code which can be used to post a message on a users wall, please note that the sample is based on Facebook C# SDK:

            /// <summary>
        /// Posts a message to wall.
        /// </summary>
        /// <param name="accessToken">User access token.</param>
        /// <param name="title">Message title.</param>
        /// <param name="description">Message description.</param>
        /// <param name="link">Message link.</param>
        /// <param name="imageUrl">Custom image url.</param>
        /// <returns></returns>       
          public bool PostMessageToWall(string accessToken, string title, string description, string link, string imageUrl)
        {
            Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(accessToken); // facebook user access token see here for more info http://developers.facebook.com/docs/reference/api/
            Dictionary<string, object> args = new Dictionary<string, object>();        
            args["from"] = ApplicationSettings.FacebookApplicationId; // this would be your own application id which you obtain from facebook
            args["description"] = description;
            args["name"] = title;
            args["link"] = link;
            args["picture"] = imageUrl;
            var obj = client.Post("/me/feed", args);
            JsonObject post = obj as JsonObject;
            if (post != null)
            {
                if (post.ContainsKey("id") && post["id"] != null)
                {
                    string id = post["id"].ToString();
                    if (!string.IsNullOrWhiteSpace(id))
                        return true;
                }
            }
            return false;
        }
Now that we have covered the Facebook integration, here is a related blog post.This article demonstrates the steps required to push blog posts to Blogger. The MonoX implementation section will be of an interest to you since it explains the steps needed to push any blog post to an external service.

Regards,
Mario

4
1/23/2013 5:41:01 PM
6018 Reputation 709 Total posts

thank you mario for the code - I deeply appreciate it

5
This is a demo site for MonoX. Please visit Mono Software for more info.