Exemplo n.º 1
0
        public int postRssFeeds(object data)
        {
            try
               {
               TwitterAccountRepository twtAccountRepo = new TwitterAccountRepository();
               RssFeedsRepository rssFeedsRepo = new RssFeedsRepository();
               RssReaderRepository rssReadRepo = new RssReaderRepository();
               RssFeeds objrss = (RssFeeds)data;

               TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository();
               SocioBoard.Domain.TwitterAccount twtaccount = twtaccountrepo.getUserInformation(objrss.ProfileScreenName,objrss.UserId);
               TwitterHelper twthelper = new TwitterHelper();
               oAuthTwitter OAuthTwt = new oAuthTwitter();
               OAuthTwt.AccessToken = twtaccount.OAuthToken;
               OAuthTwt.AccessTokenSecret = twtaccount.OAuthSecret;
               OAuthTwt.TwitterScreenName = twtaccount.TwitterScreenName;
               OAuthTwt.TwitterUserId = twtaccount.TwitterUserId;
               OAuthTwt.ConsumerKey = ConfigurationManager.AppSettings["consumerKey"];
               OAuthTwt.ConsumerKeySecret = ConfigurationManager.AppSettings["consumerSecret"];
               twthelper.SetCofigDetailsForTwitter(OAuthTwt);
               Tweet twt = new Tweet();
               List<RssReader> lstRssReader= rssReadRepo.geturlRssFeed(objrss.FeedUrl);
               foreach (RssReader rss in lstRssReader)
               {
                     JArray post = twt.Post_Statuses_Update(OAuthTwt, rss.Title);
                     rssReadRepo.UpdateStatus(rss.Id);
               }
               return 0;
               }
               catch (Exception ex)
               {
               Console.WriteLine(ex.StackTrace);
               return 0;
               }
        }