Example usage for twitter4j Twitter updateProfile

List of usage examples for twitter4j Twitter updateProfile

Introduction

In this page you can find the example usage for twitter4j Twitter updateProfile.

Prototype

User updateProfile(String name, String url, String location, String description) throws TwitterException;

Source Link

Document

Sets values that users are able to set under the "Account" tab of their settings page.

Usage

From source file:de.vanita5.twittnuker.util.TwitterWrapper.java

License:Open Source License

public static SingleResponse<ParcelableUser> updateProfile(final Context context, final long account_id,
        final String name, final String url, final String location, final String description) {
    final Twitter twitter = getTwitterInstance(context, account_id, false);
    if (twitter != null) {
        try {/*from   w  w w  .  java 2  s .c  o  m*/
            final User user = twitter.updateProfile(name, url, location, description);
            return new SingleResponse<ParcelableUser>(new ParcelableUser(user, account_id), null);
        } catch (final TwitterException e) {
            return new SingleResponse<ParcelableUser>(null, e);
        }
    }
    return SingleResponse.getInstance();
}

From source file:org.getlantern.firetweet.util.TwitterWrapper.java

License:Open Source License

public static SingleResponse<ParcelableUser> updateProfile(final Context context, final long account_id,
        final String name, final String url, final String location, final String description) {
    final Twitter twitter = getTwitterInstance(context, account_id, false);
    if (twitter != null) {
        try {//from  ww  w  .  ja v  a 2 s .  c o m
            final User user = twitter.updateProfile(name, url, location, description);
            return new SingleResponse<>(new ParcelableUser(user, account_id), null);
        } catch (final TwitterException e) {
            Crashlytics.logException(e);
            return new SingleResponse<>(null, e);
        }
    }
    return SingleResponse.getInstance();
}

From source file:org.mariotaku.twidere.util.TwitterWrapper.java

License:Open Source License

public static SingleResponse<ParcelableUser> updateProfile(final Context context, final long account_id,
        final String name, final String url, final String location, final String description) {
    final Twitter twitter = getTwitterInstance(context, account_id, false);
    if (twitter != null) {
        try {//from   w ww  .  j ava 2s.  c  o  m
            final User user = twitter.updateProfile(name, url, location, description);
            return new SingleResponse<>(new ParcelableUser(user, account_id), null);
        } catch (final TwitterException e) {
            return new SingleResponse<>(null, e);
        }
    }
    return SingleResponse.getInstance();
}

From source file:twitter4j.examples.account.UpdateProfile.java

License:Apache License

/**
 * Usage: java twitter4j.examples.account.UpdateProfile [name] [url] [location] [description]
 *
 * @param args message//from   ww w  .  ja v a2 s.  co  m
 */
public static void main(String[] args) {
    if (args.length < 4) {
        System.out.println(
                "Usage: java twitter4j.examples.account.UpdateProfile [name] [url] [location] [description]");
        System.exit(-1);
    }
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        twitter.updateProfile(args[0], args[1], args[2], args[3]);
        System.out.println("Successfully updated profile.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to update profile: " + te.getMessage());
        System.exit(-1);
    }
}