Examples of TwitterProfile


Examples of org.agorava.twitter.model.TwitterProfile

    @Inject
    private Repository<User> repository;

    //public void registerUser(@Observes SocialEvent<OAuthSession> event) { https://issues.jboss.org/browse/AGOVA-53
    public void registerUser(@Observes SuccessfulAuthentication event) {
        TwitterProfile profile = (TwitterProfile)event.getProfile();

        User user = repository.get(profile.getScreenName());
        if(user == null) {
            user = new User(profile.getScreenName());
        }
        user.setName(profile.getFullName());
        user.setBio(profile.getDescription());
        user.setAvatarUrl(profile.getProfileImageUrl());
        OAuthToken token = event.getToken();
        user.setAccessToken(token.getSecret() + "|" + token.getToken());
        if(user.getApiToken() == null) {
            user.setApiToken(UUID.randomUUID().toString());
        }
View Full Code Here

Examples of org.pac4j.oauth.profile.twitter.TwitterProfile

        kryo.register(TwitterProfile.class);
    }

    @Override
    protected void verifyProfile(final UserProfile userProfile) {
        final TwitterProfile profile = (TwitterProfile) userProfile;
        logger.debug("userProfile : {}", profile);
        assertEquals("488358057", profile.getId());
        assertEquals(TwitterProfile.class.getSimpleName() + UserProfile.SEPARATOR + "488358057", profile.getTypedId());
        assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), TwitterProfile.class));
        assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
        assertCommonProfile(userProfile, null, null, null, "test scribeUP", "testscribeUP", Gender.UNSPECIFIED,
                Locale.UK, ".twimg.com/sticky/default_profile_images/default_profile_5_normal.png",
                "http://t.co/fNjYqp7wZ8", "New York");
        assertFalse(profile.getContributorsEnabled());
        assertEquals(TestsHelper.getFormattedDate(1328872224000L, "EEE MMM dd HH:mm:ss Z yyyy", Locale.US), profile
                .getCreatedAt().toString());
        assertTrue(profile.getDefaultProfile());
        assertTrue(profile.getDefaultProfileImage());
        assertEquals("biographie", profile.getDescription());
        assertEquals(0, profile.getFavouritesCount().intValue());
        assertFalse(profile.getFollowRequestSent());
        assertEquals(0, profile.getFollowersCount().intValue());
        assertFalse(profile.getFollowing());
        assertEquals(0, profile.getFriendsCount().intValue());
        assertFalse(profile.getGeoEnabled());
        assertFalse(profile.getIsTranslator());
        assertEquals(0, profile.getListedCount().intValue());
        assertFalse(profile.getNotifications());
        assertTrue(profile.getProfileBackgroundColor() instanceof Color);
        assertTrue(profile.getProfileBackgroundImageUrl().contains(".twimg.com/images/themes/theme1/bg.png"));
        assertTrue(profile.getProfileBackgroundImageUrlHttps().endsWith("/images/themes/theme1/bg.png"));
        assertFalse(profile.getProfileBackgroundTile());
        assertTrue(profile.getProfileImageUrlHttps().endsWith(
                "/sticky/default_profile_images/default_profile_5_normal.png"));
        assertTrue(profile.getProfileLinkColor() instanceof Color);
        assertTrue(profile.getProfileSidebarBorderColor() instanceof Color);
        assertTrue(profile.getProfileSidebarFillColor() instanceof Color);
        assertTrue(profile.getProfileTextColor() instanceof Color);
        assertTrue(profile.getProfileUseBackgroundImage());
        assertTrue(profile.getProtected());
        assertNull(profile.getShowAllInlineMedia());
        assertEquals(0, profile.getStatusesCount().intValue());
        assertEquals("Amsterdam", profile.getTimeZone());
        assertEquals(7200, profile.getUtcOffset().intValue());
        assertFalse(profile.getVerified());
        assertNotNull(profile.getAccessSecret());
        assertEquals(37, profile.getAttributes().size());
    }
View Full Code Here

Examples of org.pac4j.oauth.profile.twitter.TwitterProfile

        }
    }
   
    @Override
    protected TwitterProfile extractUserProfile(final String body) {
        final TwitterProfile profile = new TwitterProfile();
        final JsonNode json = JsonHelper.getFirstNode(body);
        if (json != null) {
            profile.setId(JsonHelper.get(json, "id"));
            for (final String attribute : OAuthAttributesDefinitions.twitterDefinition.getAllAttributes()) {
                profile.addAttribute(attribute, JsonHelper.get(json, attribute));
            }
        }
        return profile;
    }
View Full Code Here

Examples of org.pac4j.oauth.profile.twitter.TwitterProfile

   
    @SuppressWarnings("unused")
    public void testProfileTwitterCreation() {
        final long t0 = System.currentTimeMillis();
        for (int i = 0; i < MAX_TWITTER; i++) {
            final TwitterProfile twitterProfile = benchTwitterClient.createProfile(TWITTER_RESPONSE);
        }
        final long t1 = System.currentTimeMillis();
        logger.warn(MAX_TWITTER + " Twitter profile creations took : " + (t1 - t0) + " ms");
    }
View Full Code Here

Examples of org.springframework.social.twitter.api.TwitterProfile

                FacebookProfile profile = ((Facebook) api).userOperations().getUserProfile();
                user.setEmail(profile.getEmail());
                user.setNames(profile.getName());
                user.setUsername(profile.getUsername());
            } else if (api instanceof Twitter) {
                TwitterProfile profile = ((Twitter) api).userOperations().getUserProfile();
                user.setNames(profile.getName());
                user.setUsername(profile.getScreenName());
            }
        } else {
            user.setEmail(email);
            model.addAttribute("type", "Persona");
        }
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.