public string FacebookComposeMessageRss(string message, string profileid, string userid, string title, string link)
        {
            string ret = "";
            Domain.Socioboard.Domain.FacebookAccount objFacebookAccount = objFacebookAccountRepository.getFacebookAccountDetailsById(profileid, Guid.Parse(userid));
            FacebookClient fb = new FacebookClient();

            try
            {
                fb.AccessToken = objFacebookAccount.AccessToken;
                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;
                var args = new Dictionary<string, object>();
                args["message"] = message;
                args["description"] = title;
                args["link"] = link;
                ret = fb.Post("v2.0/" + objFacebookAccount.FbUserId + "/feed", args).ToString();
                RssFeedsRepository objrssfeed = new RssFeedsRepository();
                objrssfeed.updateFeedStatus(Guid.Parse(userid), message);
                return ret = "Messages Posted Successfully";
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return ret = "Message Could Not Posted";
            }
        }
Esempio n. 2
0
 public string TwitterComposeMessageRss(string message, string profileid, string userid)
 {
     string ret = "";
     Domain.Socioboard.Domain.TwitterAccount objTwitterAccount = objTwitterAccountRepository.GetUserInformation(Guid.Parse(userid), profileid);
     oAuthTwitter OAuthTwt = new oAuthTwitter();
     OAuthTwt.AccessToken = objTwitterAccount.OAuthToken;
     OAuthTwt.AccessTokenSecret = objTwitterAccount.OAuthSecret;
     OAuthTwt.TwitterScreenName = objTwitterAccount.TwitterScreenName;
     OAuthTwt.TwitterUserId = objTwitterAccount.TwitterUserId;
     this.SetCofigDetailsForTwitter(OAuthTwt);
     Tweet twt = new Tweet();
     try
     {
         JArray post = twt.Post_Statuses_Update(OAuthTwt, message);
         RssFeedsRepository objrssfeed = new RssFeedsRepository();
         objrssfeed.updateFeedStatus(Guid.Parse(userid), message);
         return ret = "Messages Posted Successfully";
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return ret = "Message Could Not Posted";
     }
 }
         public string LinkedinComposeMessageRss(string message, string profileid, string userid)
         {
             string ret = "";
             LinkedInAccount LinkedAccount;
             string authLink = string.Empty;
             LinkedInAccountRepository linkedinAccRepo = new LinkedInAccountRepository();
             if (linkedinAccRepo.checkLinkedinUserExists(profileid, Guid.Parse(userid)))
             {
                 LinkedAccount = linkedinAccRepo.getUserInformation(Guid.Parse(userid), profileid);
             }
             else
             {
                 LinkedAccount = linkedinAccRepo.getUserInformation(profileid);
             }
             oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();
             Linkedin_oauth.Verifier = LinkedAccount.OAuthVerifier;
             Linkedin_oauth.TokenSecret = LinkedAccount.OAuthSecret;
             Linkedin_oauth.Token = LinkedAccount.OAuthToken;
             Linkedin_oauth.Id = LinkedAccount.LinkedinUserId;
             Linkedin_oauth.FirstName = LinkedAccount.LinkedinUserName;
             SocialStream sociostream = new SocialStream();

             try
             {
                 ret = sociostream.SetStatusUpdate(Linkedin_oauth, message);
                 RssFeedsRepository objrssfeed = new RssFeedsRepository();
                 objrssfeed.updateFeedStatus(Guid.Parse(userid), message);
                 return ret = "Messages Posted Successfully";
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.Message);
                 return ret = "Message Could Not Posted";
             }
         }