24 Ağustos 2014 Pazar

Facebook Hayran Sayfasına Mesaj atma

  Facebook a c# ile post gönderme işlemi yapan bir kod.Kendi profilinize göndermek için blog id yerine me yazmanız yeterli.

dynamic messagePost = new ExpandoObject();
            messagePost.picture = "http://www.ileriduzeyseo.com/wp-content/uploads/2014/08/yandex.png";
            messagePost.link = "http://www.google.com.tr";
            messagePost.name = "test";

            messagePost.caption = "seo test";
            messagePost.description =
                "test seo";
            messagePost.message = "seo";

            string acccessToken =
                "accesstokenburaya giriceksiniz";
//https://developers.facebook.com/tools/explorer/?method=GET burdan izinleri onaylayıp alın
            FacebookClient appp = new FacebookClient(acccessToken);
            try
            {
                var postId = appp.Post("hayransayfasıidsi" + "/feed", messagePost);
            }
            catch (FacebookOAuthException ex)
            {
                //handle oauth exception
            }
            catch (FacebookApiException ex)
            {
                //handle facebook exception
            }

Hiç yorum yok:

Yorum Gönder