Examples of LinkedInProfile


Examples of org.encuestame.social.api.support.LinkedInProfile

     *
     */
    @Override
    public SocialUserProfile getProfile() throws Exception {
        final SocialUserProfile profile = new SocialUserProfile();
        final LinkedInProfile inProfile = getUserProfile();
        profile.setFirstName(inProfile.getFirstName());
        profile.setId(inProfile.getId());
        profile.setHeadline(inProfile.getHeadline());
        profile.setIndustry(inProfile.getIndustry());
        profile.setLastName(inProfile.getLastName());
        profile.setProfileUrl(inProfile.getPublicProfileUrl());
        profile.setProfileImageUrl(inProfile.getPictureUrl());
        profile.setUrl(inProfile.getStandardProfileUrl());
        profile.setUsername(inProfile.getProfileUrl()); //TODO: linkedIn provide username?
        return profile;
    }
View Full Code Here

Examples of org.encuestame.social.api.support.LinkedInProfile

                }
            } else if (socialProvider.equals(SocialProvider.LINKEDIN)) {
                LinkedInAPIOperations apiOperations = new LinkedInAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                LinkedInProfile profile = apiOperations.getUserProfile();
                SocialUserProfile profileAPI = apiOperations.getProfile();
                log.debug("linkedin profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profileAPI,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.TWITTER)) {
                TwitterAPIOperations operations = new TwitterAPITemplate(consumerSecret, apiKey, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = operations.getProfile();
                log.debug("twitter profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
                //FUTURE - Issues with OAuth1 request.
            } else if (socialProvider.equals(SocialProvider.YAHOO)) {
                //FUTURE - Only valid on defined domain.
                log.debug("Yahoo provider is disabled");
               
            } else if (socialProvider.equals(SocialProvider.PLURK)) {
              PlurkAPIOperations  apiOperations = new PlurkAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = apiOperations.getProfile();
                log.debug("plurk profile " + profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.TUMBLR)) {
              TumblrAPIOperations apiOperations = new TumblrAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = apiOperations.getProfile();
                log.debug("linkedin profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
View Full Code Here

Examples of org.encuestame.social.api.support.LinkedInProfile

        String apiSecret = "3Tuj7nXvACdCwffnbh-NkUXQ_Re0t1FPakogEPApw_3DBsfowdQuoggCCTd38a9o";
        String token = "e222076b-f187-474a-9ffd-1c7f27760fec";
        String tokenSecret = "75db960b-2951-48c4-b030-293166a0de8f";

        LinkedInAPITemplate tp = new LinkedInAPITemplate(apiKey, apiSecret, token, tokenSecret);
        LinkedInProfile p =  tp.getUserProfile();
        tp.updateStatus("Probando LinkedIn API desde @encuestame, twitter activado", true);
        final List<LinkedInProfile> list = tp.getConnections();
        for (LinkedInProfile linkedInProfile : list) {
            //System.out.println("&&&&&&&&&&&&&&&&&&&&& "+linkedInProfile.getFirstName());
            //System.out.println("&&&&&&&&&&&&&&&&&&&&& "+linkedInProfile.getHeadline());
View Full Code Here

Examples of org.pac4j.oauth.profile.linkedin.LinkedInProfile

        kryo.register(LinkedInProfile.class);
    }
   
    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final LinkedInProfile profile = (LinkedInProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals("167439971", profile.getId());
        assertEquals(LinkedInProfile.class.getSimpleName() + UserProfile.SEPARATOR + "167439971", profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), LinkedInProfile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertCommonProfile(userProfile,
                            null,
                            "test",
                            "scribeUp",
                            "test scribeUp",
                            null,
                            Gender.UNSPECIFIED,
                            null,
                            null,
                            "http://www.linkedin.com/profile/view?id=167439971&amp;authType=name&amp;authToken=_IWF&amp;trk=api*",
                            null);
        assertEquals("ScribeUP développeur chez OpenSource", profile.getHeadline());
        assertNotNull(profile.getAccessSecret());
        assertEquals(6, profile.getAttributes().size());
    }
View Full Code Here

Examples of org.pac4j.oauth.profile.linkedin.LinkedInProfile

        }
    }
   
    @Override
    protected LinkedInProfile extractUserProfile(final String body) {
        final LinkedInProfile profile = new LinkedInProfile();
        for (final String attribute : OAuthAttributesDefinitions.linkedinDefinition.getAllAttributes()) {
            final String value = StringUtils.substringBetween(body, "<" + attribute + ">", "</" + attribute + ">");
            profile.addAttribute(attribute, value);
            if (LinkedInAttributesDefinition.URL.equals(attribute)) {
                final String id = StringUtils.substringBetween(value, "id=", "&amp;authType=");
                profile.setId(id);
            }
        }
        return profile;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.