Package twitter4j

Examples of twitter4j.User


* @author Enno Shioji (enno.shioji@peerindex.com)
*/
public class OnlyEnglish extends BaseFilter {
    @Override
    public boolean isKeep(TridentTuple tuple) {
        User user = (User)tuple.get(0);

        return "en".equals(user.getLang());
    }
View Full Code Here


*/
public class ExtractFollowerClassAndContentName extends BaseFunction {
    @Override
    public void execute(TridentTuple tuple, TridentCollector collector) {
        Content content = (Content)tuple.get(0);
        User user = (User)tuple.get(1);

        String followerClass = classify(user.getFollowersCount());

        collector.emit(new Values(followerClass, content.getContentName()));
    }
View Full Code Here

    public void execute(TridentTuple tuple, TridentCollector collector) {
        if(extracter == null) extracter = new ContentExtracter();

        String rawTweetJson = (String)tuple.get(0);
        Status parsed = parse(rawTweetJson);
        User user = parsed.getUser();

        for (Content content : extracter.extract(parsed)) {
            collector.emit(new Values(parsed, content, user));
        }
    }
View Full Code Here

    String verifier = request.getParameter("oauth_verifier");
    twitter.setOAuthConsumer(key, secret);

    try {
      twitter.getOAuthAccessToken(token, verifier);
      User user = twitter.verifyCredentials();
      log.info("Twitter user found:" + user.getName());
      request.getSession().removeAttribute("requestToken");
      String sid = ((Integer) user.getId()).toString();

      UserAccount u = new UserAccount(sid, AuthenticationProvider.TWITTER);
      // use screen name for uid
      u.setName(user.getScreenName());
      UserAccount connectr = new LoginHelper().loginStarts(request.getSession(), u);
      log.info("User id:" + connectr.getId().toString());

    } catch (TwitterException e) {
      e.printStackTrace();
View Full Code Here

     * @param args message
     */
    public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            User user = twitter.verifyCredentials();
            System.out.println("Successfully verified credentials of " + user.getScreenName());
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to verify credentials: " + te.getMessage());
            System.exit(-1);
View Full Code Here

            System.out.println("Usage: java twitter4j.examples.user.ShowUser [screen name]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            User user = twitter.showUser(args[0]);
            if (user.getStatus() != null) {
                System.out.println("@" + user.getScreenName() + " - " + user.getStatus().getText());
            } else {
                // the user is protected
                System.out.println("@" + user.getScreenName());
            }
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to delete status: " + te.getMessage());
View Full Code Here

TOP

Related Classes of twitter4j.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.