Package net.fortytwo.twitlogic.model

Examples of net.fortytwo.twitlogic.model.User


    private TokenizedObjectPropertyClause forUsernameObject(final String normed) {
        ThreeParts t = divide(normed, TweetSyntax.USERNAME_PATTERN);
        return null == t
                ? null
                : new TokenizedObjectPropertyClause(t.first, new User(t.second.substring(1)).getHeldBy(), t.third);
    }
View Full Code Here


    public Thing persist(final URIReference uri) {
        return designate(uri.getValue(), Thing.class);
    }

    public Agent persist(final net.fortytwo.twitlogic.model.Person tweetPerson) {
        User tweetUser = tweetPerson.getAccount();
        UserAccount userAccount = persist(tweetUser);
        return userAccount.getAccountOf();
    }
View Full Code Here

            usersByScreenName.put(user.getScreenName(), user);
        }
    }

    public Long resolveUserId(final String screenName) throws TwitterClientException {
        User user = usersByScreenName.get(screenName);

        if (null == user) {
            user = client.findUserInfo(screenName);
            add(user);
        }

        return user.getId();
    }
View Full Code Here

            }
        };
    }

    public User findUserInfo(final String screenName) throws TwitterClientException {
        User user = client.findUserInfo(screenName);
        add(user);
        return user;
    }
View Full Code Here

        String link = null;
        if (TweetSyntax.HASHTAG_PATTERN.matcher(text).matches()) {
            link = PersistenceContext.uriOf(new Hashtag(text.substring(1)));
        } else if (TweetSyntax.USERNAME_PATTERN.matcher(text).matches()) {
            link = PersistenceContext.uriOf(new User(text.substring(1)).getHeldBy());
        }

        if (null == link) {
            response = dontUnderstand(request);
        } else {
View Full Code Here

                if (!CONFIG_LIST_PATTERN.matcher(listVal).matches()) {
                    throw new PropertyException("invalid list: " + listVal + " (should be of the form user_name/list_id)");
                }

                String[] parts = listVal.split("/");
                User user = new User(parts[0]);
                String listId = parts[1];

                List<User> l = client.getListMembers(user, listId);
                users.addAll(l);
            } else if (key.startsWith(TwitLogic.FOLLOWUSER)) {
                String screenName = props.getString(key);
                if (!CONFIG_USERNAME_PATTERN.matcher(screenName).matches()) {
                    throw new PropertyException("invalid screen name: " + screenName);
                }

                // Twitter requires user IDs (as opposed to screen names) for follow filters.
                User u = client.findUserInfo(screenName);
                users.add(u);
            } else if (key.startsWith(TwitLogic.FOLLOWFOLLOWED)) {
                String screenName = props.getString(key);
                if (!CONFIG_USERNAME_PATTERN.matcher(screenName).matches()) {
                    throw new PropertyException("invalid screen name: " + screenName);
                }

                // Twitter requires user IDs (as opposed to screen names) for follow filters.
                User u = client.findUserInfo(screenName);

                List<User> l = client.getFollowees(u, -1);
                users.addAll(l);
            }
        }
View Full Code Here

                    rateLimiter.handle(e);
                }
            }

            for (long id : ids.getIDs()) {
                users.add(new User(id));

                if (limit > 0 && ++total >= limit) {
                    // if the limit is reached, exit early
                    return users;
                }
View Full Code Here

                    rateLimiter.handle(e);
                }
            }

            for (long id : ids.getIDs()) {
                users.add(new User(id));

                if (limit > 0 && ++total >= limit) {
                    // if the limit is reached, exit early
                    return users;
                }
View Full Code Here

        for (twitter4j.User u : asList(new ListGenerator<twitter4j.User>() {
            public PagableResponseList getList(long cursor) throws TwitterException {
                return twitter.getUserListMembers(list.getId(), cursor);
            }
        })) {
            result.add(new User(u));
        }

        for (User u : result) {
            LOGGER.info("\tfound: " + u);
        }
View Full Code Here

        throw new UnsupportedOperationException("not yet implemented");
    }

    public synchronized User findUserInfo(final String screenName) throws TwitterClientException {
        try {
            return new User(twitter.showUser(screenName));
        } catch (TwitterException e) {
            throw new TwitterClientException(e);
        }
    }
View Full Code Here

TOP

Related Classes of net.fortytwo.twitlogic.model.User

Copyright © 2018 www.massapicom. 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.