Ejemplo n.º 1
0
        private List <Message> GetUserWallLinkedIn(object tenant)
        {
            CoreContext.TenantManager.SetCurrentTenant((Tenant)tenant);

            List <Message> messageList = new List <Message>();

            try
            {
                LinkedInDataProvider provider = new LinkedInDataProvider(LinkedInInformation.TokenManager, LinkedInInformation.AccessToken);
                messageList.AddRange(provider.GetCurrentUserNetworkUpdates(MessageCount));
            }
            catch (Exception ex)
            {
                ThrownExceptions.Add(ex);
            }
            return(messageList);
        }
Ejemplo n.º 2
0
        public string SaveUserAvatarFromSocialNetwork(int contactID, SocialNetworks socialNetwork, string userIdentity)
        {
            try
            {
                //Process authorization
                if (!ProcessAuthorization(HttpContext.Current))
                {
                    AccessDenied(HttpContext.Current);
                    return(null);
                }
                if (socialNetwork == SocialNetworks.Twitter)
                {
                    TwitterDataProvider provider = new TwitterDataProvider(TwitterApiHelper.GetTwitterApiInfoForCurrentUser());
                    string imageUrl = provider.GetUrlOfUserImage(userIdentity, TwitterDataProvider.ImageSize.Original);
                    return(SaveAvatar(contactID, imageUrl));
                }
                if (socialNetwork == SocialNetworks.Facebook)
                {
                    FacebookDataProvider provider = new FacebookDataProvider(FacebookApiHelper.GetFacebookApiInfoForCurrentUser());
                    string imageUrl = provider.GetUrlOfUserImage(userIdentity, FacebookDataProvider.ImageSize.Original);
                    return(SaveAvatar(contactID, imageUrl));
                }

                if (socialNetwork == SocialNetworks.LinkedIn)
                {
                    LinkedInDataProvider provider = LinkedInApiHelper.GetLinkedInDataProviderForCurrentUser();
                    string imageUrl = provider.GetUrlOfUserImage(userIdentity);
                    return(SaveAvatar(contactID, imageUrl));
                }
                return(null);
            }
            catch (Exception ex)
            {
                throw ProcessError(ex, "SaveUserAvatarFromSocialNetwork");
            }
        }
Ejemplo n.º 3
0
 public void GetUserInfoTest()
 {
     var tokenManager = new LinkedInDBTokenManager("qnwIL9_wRC4Ew3iLl5sdEKvEDaSTgFn-RRaedF0XfXLZov0jDCq577Ta6wDLZr_8", "gJCNJ4UsvfCgPGHQRQt0CJ82GZTN6njeT1XxhyUaSsYHBAtCf58EE0P0ocBcLLqp");
     var provider     = new LinkedInDataProvider(tokenManager, "8a17d3b4-5e99-4f5f-8ad3-5c9f0b28d9d1");
     var userInfo     = provider.GetUserInfo("A_lDUH3Vb3");
 }