Пример #1
0
        //public static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> GetUserProfilesSnapsAccordingToGroup(List<Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile)
        //{
        //    User objUser = (User)System.Web.HttpContext.Current.Session["User"];
        //    Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> dic_profilessnap = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>>();
        //    var dicprofilefeeds = new Dictionary<object, List<object>>();
        //    foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile)
        //    {
        //        List<object> feeds = null;
        //        if (item.ProfileType == "facebook" || item.ProfileType == "facebook_page")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
        //                FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount)));
        //                Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
        //                //List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>)));
        //                List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<FacebookFeed>)));

        //                foreach (var facebookfeed in lstFacebookFeed)
        //                {
        //                    feeds.Add(facebookfeed);
        //                }
        //                dicprofilefeeds.Add(objFacebookAccount, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }

        //        if (item.ProfileType == "twitter")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
        //                TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount)));
        //                Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
        //                //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>)));
        //                List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.getAllFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(),"0","10"), typeof(List<TwitterFeed>)));
        //                foreach (var twitterfeed in lstTwitterFeed)
        //                {
        //                    feeds.Add(twitterfeed);
        //                }
        //                dicprofilefeeds.Add(objTwitterAccount, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }

        //        if (item.ProfileType == "linkedin")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
        //                LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount)));
        //                Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
        //                //List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>)));
        //                List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<LinkedInFeed>)));

        //                foreach (var LinkedInFeed in lstLinkedInFeed)
        //                {
        //                    feeds.Add(LinkedInFeed);
        //                }
        //                dicprofilefeeds.Add(objLinkedInAccount, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }
        //        if (item.ProfileType == "instagram")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
        //                InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount)));
        //                dicprofilefeeds.Add(objInstagramAccount, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }

        //        if (item.ProfileType == "tumblr")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
        //                TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount)));
        //                dicprofilefeeds.Add(objTumblrAccount, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }


        //        if (item.ProfileType == "youtube")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
        //                YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount)));
        //                Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
        //                YoutubeChannel objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel)));
        //                List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>();
        //                lstYoutubeChannel.Add(objYoutubeChannel);
        //                foreach (var youtubechannel in lstYoutubeChannel)
        //                {
        //                    feeds.Add(youtubechannel);
        //                }
        //                dicprofilefeeds.Add(objYoutubeAccount, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }

        //        if (item.ProfileType == "linkedincompanypage")
        //        {
        //            try
        //            {
        //                feeds = new List<object>();
        //                Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
        //                LinkedinCompanyPage objLinkedinCompanypage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedinCompanyPage)));
        //                Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
        //                List<LinkedinCompanyPagePosts> lstlipagepost = (List<LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedinCompanyPagePosts>)));
        //                foreach (var lipagepost in lstlipagepost)
        //                {
        //                    feeds.Add(lipagepost);
        //                }
        //                dicprofilefeeds.Add(objLinkedinCompanypage, feeds);
        //                dic_profilessnap.Add(item, dicprofilefeeds);
        //            }
        //            catch (Exception ex)
        //            {
        //                Console.WriteLine(ex.Message);
        //            }
        //        }

        //    }
        //    return dic_profilessnap;
        //}
        public static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> GetUserProfilesSnapsAccordingToGroup(List<Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile, int CountProfileSnapshot = 0)
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> dic_profilessnap = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>>();
            var dicprofilefeeds = new Dictionary<object, List<object>>();

            int tempCount = 0;
            foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile)
            {
                tempCount++;
                if (tempCount <= CountProfileSnapshot)
                {
                    continue;
                }

                //to load only 3 profiles on home page load to speed up page loading
                if (dic_profilessnap.Count >= 3)
                {
                    break;
                }

                List<object> feeds = null;
                if (item.ProfileType == "facebook" || item.ProfileType == "facebook_page")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                        ApiobjFacebookAccount.Timeout = 300000;
                        FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount)));
                        Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
                        ApiobjFacebookFeed.Timeout = 300000;
                        //List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>)));
                        List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<FacebookFeed>)));

                        foreach (var facebookfeed in lstFacebookFeed)
                        {
                            feeds.Add(facebookfeed);
                        }
                        dicprofilefeeds.Add(objFacebookAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "twitter")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                        TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount)));
                        Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
                        ApiobjTwitterFeed.Timeout = 300000;
                        //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>)));
                        List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.getAllFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<TwitterFeed>)));
                        foreach (var twitterfeed in lstTwitterFeed)
                        {
                            feeds.Add(twitterfeed);
                        }
                        dicprofilefeeds.Add(objTwitterAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "linkedin")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                        ApiobjLinkedinAccount.Timeout = 300000;
                        LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount)));
                        Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
                        ApiobjLinkedInFeed.Timeout = 300000;
                        //List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>)));
                        List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List<LinkedInFeed>)));

                        foreach (var LinkedInFeed in lstLinkedInFeed)
                        {
                            feeds.Add(LinkedInFeed);
                        }
                        dicprofilefeeds.Add(objLinkedInAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
                if (item.ProfileType == "instagram")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                        ApiobjInstagramAccount.Timeout = 300000;
                        InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount)));
                        dicprofilefeeds.Add(objInstagramAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "tumblr")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                        ApiobjTumblrAccount.Timeout = 300000;
                        TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount)));
                        dicprofilefeeds.Add(objTumblrAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }


                if (item.ProfileType == "youtube")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                        ApiobjYoutubeAccount.Timeout = 300000; 
                        YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount)));
                        Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
                        ApiobjYoutubeChannel.Timeout = 300000; 
                        YoutubeChannel objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel)));
                        List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>();
                        lstYoutubeChannel.Add(objYoutubeChannel);
                        foreach (var youtubechannel in lstYoutubeChannel)
                        {
                            feeds.Add(youtubechannel);
                        }
                        dicprofilefeeds.Add(objYoutubeAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "linkedincompanypage")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                        ApiobjLinkedinCompanyPage.Timeout = 300000; 
                        LinkedinCompanyPage objLinkedinCompanypage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedinCompanyPage)));
                        Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                        ApiobjLinkedinCompanyPage.Timeout = 300000;
                        List<LinkedinCompanyPagePosts> lstlipagepost = (List<LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedinCompanyPagePosts>)));
                        foreach (var lipagepost in lstlipagepost)
                        {
                            feeds.Add(lipagepost);
                        }
                        dicprofilefeeds.Add(objLinkedinCompanypage, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
                if (item.ProfileType == "gplus")
                {
                    try
                    {
                        feeds = new List<object>();
                        Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount();
                        ApiobjGooglePlusAccount.Timeout = 300000; 
                        Domain.Socioboard.Domain.GooglePlusAccount _GooglePlusAccount = (GooglePlusAccount)new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), item.ProfileId), typeof(GooglePlusAccount));
                        dicprofilefeeds.Add(_GooglePlusAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

            }
            return dic_profilessnap;
        }
Пример #2
0
 public ActionResult YoutubeChannelVideos(string profileid)
 {
     Api.YoutubeChannel.YoutubeChannel ApiYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
     List<Domain.Socioboard.MongoDomain.YouTubeFeed> lstYouTubeFeed = (List<Domain.Socioboard.MongoDomain.YouTubeFeed>)new JavaScriptSerializer().Deserialize(ApiYoutubeChannel.GetAllYoutubeVideos(profileid), typeof(List<Domain.Socioboard.MongoDomain.YouTubeFeed>));
     return PartialView("_YouTubeFeedPartial", lstYouTubeFeed);
 }
Пример #3
0
        public static Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> GetUserProfilesSnapsAccordingToGroup(List<Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile)
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>> dic_profilessnap = new Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, Dictionary<object, List<object>>>();
            var dicprofilefeeds = new Dictionary<object, List<object>>();
            foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile)
            {
                List<object> feeds = null;
                if (item.ProfileType == "facebook")
                {
                    feeds = new List<object>();
                    Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                    FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount)));
                    Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
                    List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>)));
                    foreach (var facebookfeed in lstFacebookFeed)
                    {
                        feeds.Add(facebookfeed);
                    }
                    dicprofilefeeds.Add(objFacebookAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "twitter")
                {
                    feeds = new List<object>();
                    Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                    TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount)));
                    Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
                    List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>)));
                    foreach (var twitterfeed in lstTwitterFeed)
                    {
                        feeds.Add(twitterfeed);
                    }
                    dicprofilefeeds.Add(objTwitterAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "linkedin")
                {
                    feeds = new List<object>();
                    Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                    LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount)));
                    Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
                    List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>)));
                    foreach (var LinkedInFeed in lstLinkedInFeed)
                    {
                        feeds.Add(LinkedInFeed);
                    }
                    dicprofilefeeds.Add(objLinkedInAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }
                if (item.ProfileType == "instagram")
                {
                    feeds = new List<object>();
                    Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                    InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount)));
                    dicprofilefeeds.Add(objInstagramAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "tumblr")
                {
                    feeds = new List<object>();
                    Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                    TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount)));
                    dicprofilefeeds.Add(objTumblrAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }


                if (item.ProfileType == "youtube")
                {
                    feeds = new List<object>();
                    Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                    YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount)));
                    Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
                    YoutubeChannel objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel)));
                    List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>();
                    lstYoutubeChannel.Add(objYoutubeChannel);
                    foreach (var youtubechannel in lstYoutubeChannel)
                    {
                        feeds.Add(youtubechannel);
                    }
                    dicprofilefeeds.Add(objYoutubeAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

            }
            return dic_profilessnap;
        }
Пример #4
0
        public static Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > > GetUserProfilesSnapsAccordingToGroup(List <Domain.Socioboard.Domain.TeamMemberProfile> TeamMemberProfile)
        {
            User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > > dic_profilessnap = new Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, Dictionary <object, List <object> > >();
            var dicprofilefeeds = new Dictionary <object, List <object> >();

            foreach (Domain.Socioboard.Domain.TeamMemberProfile item in TeamMemberProfile)
            {
                List <object> feeds = null;
                if (item.ProfileType == "facebook")
                {
                    feeds = new List <object>();
                    Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                    FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount)));
                    Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
                    List <FacebookFeed>           lstFacebookFeed    = (List <FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <FacebookFeed>)));
                    foreach (var facebookfeed in lstFacebookFeed)
                    {
                        feeds.Add(facebookfeed);
                    }
                    dicprofilefeeds.Add(objFacebookAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "twitter")
                {
                    feeds = new List <object>();
                    Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                    TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount)));
                    Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
                    List <TwitterFeed>          lstTwitterFeed    = (List <TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <TwitterFeed>)));
                    foreach (var twitterfeed in lstTwitterFeed)
                    {
                        feeds.Add(twitterfeed);
                    }
                    dicprofilefeeds.Add(objTwitterAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "linkedin")
                {
                    feeds = new List <object>();
                    Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                    LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount)));
                    Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
                    List <LinkedInFeed>           lstLinkedInFeed    = (List <LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <LinkedInFeed>)));
                    foreach (var LinkedInFeed in lstLinkedInFeed)
                    {
                        feeds.Add(LinkedInFeed);
                    }
                    dicprofilefeeds.Add(objLinkedInAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }
                if (item.ProfileType == "instagram")
                {
                    feeds = new List <object>();
                    Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                    InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount)));
                    dicprofilefeeds.Add(objInstagramAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }

                if (item.ProfileType == "tumblr")
                {
                    feeds = new List <object>();
                    Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                    TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount)));
                    dicprofilefeeds.Add(objTumblrAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }


                if (item.ProfileType == "youtube")
                {
                    feeds = new List <object>();
                    Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                    YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount)));
                    Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
                    YoutubeChannel        objYoutubeChannel = (YoutubeChannel)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeChannel)));
                    List <YoutubeChannel> lstYoutubeChannel = new List <YoutubeChannel>();
                    lstYoutubeChannel.Add(objYoutubeChannel);
                    foreach (var youtubechannel in lstYoutubeChannel)
                    {
                        feeds.Add(youtubechannel);
                    }
                    dicprofilefeeds.Add(objYoutubeAccount, feeds);
                    dic_profilessnap.Add(item, dicprofilefeeds);
                }
            }
            return(dic_profilessnap);
        }
Пример #5
0
        public static Dictionary <Domain.Socioboard.Domain.GroupProfile, Dictionary <object, List <object> > > GetUserProfilesSnapsAccordingToGroup(List <Domain.Socioboard.Domain.GroupProfile> groupProfile, User objUser, int CountProfileSnapshot = 0)
        {
            // User objUser = (User)System.Web.HttpContext.Current.Session["User"];
            Dictionary <Domain.Socioboard.Domain.GroupProfile, Dictionary <object, List <object> > > dic_profilessnap = new Dictionary <Domain.Socioboard.Domain.GroupProfile, Dictionary <object, List <object> > >();
            var dicprofilefeeds            = new Dictionary <object, List <object> >();
            List <GroupProfile> lstprofile = groupProfile.Where(t => t.ProfileType != "linkedin").ToList();
            int tempCount = 0;

            foreach (Domain.Socioboard.Domain.GroupProfile item in lstprofile)
            {
                tempCount++;
                if (tempCount <= CountProfileSnapshot)
                {
                    continue;
                }

                //to load only 3 profiles on home page load to speed up page loading
                if (dic_profilessnap.Count >= 3)
                {
                    break;
                }

                List <object> feeds = null;
                if (item.ProfileType == "facebook" || item.ProfileType == "facebook_page")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.FacebookAccount.FacebookAccount ApiobjFacebookAccount = new Api.FacebookAccount.FacebookAccount();
                        ApiobjFacebookAccount.Timeout = 300000;
                        FacebookAccount objFacebookAccount = (FacebookAccount)(new JavaScriptSerializer().Deserialize(ApiobjFacebookAccount.getFacebookAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(FacebookAccount)));
                        Api.FacebookFeed.FacebookFeed ApiobjFacebookFeed = new Api.FacebookFeed.FacebookFeed();
                        ApiobjFacebookFeed.Timeout = 300000;
                        //List<FacebookFeed> lstFacebookFeed = (List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<FacebookFeed>)));
                        List <MongoFacebookFeed> lstFacebookFeed = (List <MongoFacebookFeed>)(new JavaScriptSerializer().Deserialize(ApiobjFacebookFeed.getAllFacebookFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List <MongoFacebookFeed>)));

                        foreach (var facebookfeed in lstFacebookFeed)
                        {
                            feeds.Add(facebookfeed);
                        }
                        dicprofilefeeds.Add(objFacebookAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "twitter")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.TwitterAccount.TwitterAccount ApiobjTwitterAccount = new Api.TwitterAccount.TwitterAccount();
                        TwitterAccount objTwitterAccount = (TwitterAccount)(new JavaScriptSerializer().Deserialize(ApiobjTwitterAccount.GetTwitterAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TwitterAccount)));
                        Api.TwitterFeed.TwitterFeed ApiobjTwitterFeed = new Api.TwitterFeed.TwitterFeed();
                        ApiobjTwitterFeed.Timeout = 300000;
                        //List<TwitterFeed> lstTwitterFeed = (List<TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.GetAllTwitterFeedsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<TwitterFeed>)));
                        List <Domain.Socioboard.MongoDomain.TwitterFeed> lstTwitterFeed = (List <Domain.Socioboard.MongoDomain.TwitterFeed>)(new JavaScriptSerializer().Deserialize(ApiobjTwitterFeed.getAllFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List <Domain.Socioboard.MongoDomain.TwitterFeed>)));
                        foreach (var twitterfeed in lstTwitterFeed)
                        {
                            feeds.Add(twitterfeed);
                        }
                        dicprofilefeeds.Add(objTwitterAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "linkedin")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.LinkedinAccount.LinkedinAccount ApiobjLinkedinAccount = new Api.LinkedinAccount.LinkedinAccount();
                        ApiobjLinkedinAccount.Timeout = 300000;
                        LinkedInAccount objLinkedInAccount = (LinkedInAccount)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinAccount.GetLinkedinAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedInAccount)));
                        Api.LinkedInFeed.LinkedInFeed ApiobjLinkedInFeed = new Api.LinkedInFeed.LinkedInFeed();
                        ApiobjLinkedInFeed.Timeout = 300000;
                        //List<LinkedInFeed> lstLinkedInFeed = (List<LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeeds(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List<LinkedInFeed>)));
                        List <LinkedInFeed> lstLinkedInFeed = (List <LinkedInFeed>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedInFeed.GetLinkedInFeedsByUserIdAndProfileIdUsingLimit(objUser.Id.ToString(), item.ProfileId.ToString(), "0", "10"), typeof(List <LinkedInFeed>)));

                        foreach (var LinkedInFeed in lstLinkedInFeed)
                        {
                            feeds.Add(LinkedInFeed);
                        }
                        dicprofilefeeds.Add(objLinkedInAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
                if (item.ProfileType == "instagram")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.InstagramAccount.InstagramAccount ApiobjInstagramAccount = new Api.InstagramAccount.InstagramAccount();
                        ApiobjInstagramAccount.Timeout = 300000;
                        InstagramAccount objInstagramAccount = (InstagramAccount)(new JavaScriptSerializer().Deserialize(ApiobjInstagramAccount.UserInformation(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(InstagramAccount)));
                        dicprofilefeeds.Add(objInstagramAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "tumblr")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.TumblrAccount.TumblrAccount ApiobjTumblrAccount = new Api.TumblrAccount.TumblrAccount();
                        ApiobjTumblrAccount.Timeout = 300000;
                        TumblrAccount objTumblrAccount = (TumblrAccount)(new JavaScriptSerializer().Deserialize(ApiobjTumblrAccount.GetTumblrAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(TumblrAccount)));
                        dicprofilefeeds.Add(objTumblrAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }


                if (item.ProfileType == "youtube")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.YoutubeAccount.YoutubeAccount ApiobjYoutubeAccount = new Api.YoutubeAccount.YoutubeAccount();
                        ApiobjYoutubeAccount.Timeout = 300000;
                        YoutubeAccount objYoutubeAccount = (YoutubeAccount)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeAccount.GetYoutubeAccountDetailsById(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(YoutubeAccount)));
                        Api.YoutubeChannel.YoutubeChannel ApiobjYoutubeChannel = new Api.YoutubeChannel.YoutubeChannel();
                        ApiobjYoutubeChannel.Timeout = 300000;
                        List <YoutubeChannel> lstYoutubeChannel = (List <YoutubeChannel>)(new JavaScriptSerializer().Deserialize(ApiobjYoutubeChannel.GetAllYoutubeChannelByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <YoutubeChannel>)));
                        //List<YoutubeChannel> lstYoutubeChannel = new List<YoutubeChannel>();
                        //lstYoutubeChannel.Add(objYoutubeChannel);
                        foreach (var youtubechannel in lstYoutubeChannel)
                        {
                            feeds.Add(youtubechannel);
                        }
                        dicprofilefeeds.Add(objYoutubeAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                if (item.ProfileType == "linkedincompanypage")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPage = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                        ApiobjLinkedinCompanyPage.Timeout = 300000;
                        LinkedinCompanyPage objLinkedinCompanypage = (LinkedinCompanyPage)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPage.GetLinkedinCompanyPageDetailsByUserIdAndPageId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(LinkedinCompanyPage)));
                        Api.LinkedinCompanyPage.LinkedinCompanyPage ApiobjLinkedinCompanyPagePost = new Api.LinkedinCompanyPage.LinkedinCompanyPage();
                        ApiobjLinkedinCompanyPage.Timeout = 300000;
                        List <LinkedinCompanyPagePosts> lstlipagepost = (List <LinkedinCompanyPagePosts>)(new JavaScriptSerializer().Deserialize(ApiobjLinkedinCompanyPagePost.GetAllLinkedinCompanyPagePostsByUserIdAndProfileId(objUser.Id.ToString(), item.ProfileId.ToString()), typeof(List <LinkedinCompanyPagePosts>)));
                        foreach (var lipagepost in lstlipagepost)
                        {
                            feeds.Add(lipagepost);
                        }
                        dicprofilefeeds.Add(objLinkedinCompanypage, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
                if (item.ProfileType == "gplus")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.GooglePlusAccount.GooglePlusAccount ApiobjGooglePlusAccount = new Api.GooglePlusAccount.GooglePlusAccount();
                        ApiobjGooglePlusAccount.Timeout = 300000;
                        Domain.Socioboard.Domain.GooglePlusAccount _GooglePlusAccount = (GooglePlusAccount) new JavaScriptSerializer().Deserialize(ApiobjGooglePlusAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), item.ProfileId), typeof(GooglePlusAccount));
                        dicprofilefeeds.Add(_GooglePlusAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
                if (item.ProfileType == "googleanalytics")
                {
                    try
                    {
                        feeds = new List <object>();
                        Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount ApiobjGoogleAnalyticsAccount = new Api.GoogleAnalyticsAccount.GoogleAnalyticsAccount();
                        ApiobjGoogleAnalyticsAccount.Timeout = 300000;
                        Domain.Socioboard.Domain.GoogleAnalyticsAccount _GoogleAnalyticsAccount = (GoogleAnalyticsAccount) new JavaScriptSerializer().Deserialize(ApiobjGoogleAnalyticsAccount.GetGooglePlusAccountDetailsById(objUser.Id.ToString(), item.ProfileId), typeof(GoogleAnalyticsAccount));
                        dicprofilefeeds.Add(_GoogleAnalyticsAccount, feeds);
                        dic_profilessnap.Add(item, dicprofilefeeds);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
            }

            return(dic_profilessnap);
        }