Example usage for twitter4j User getProfileImageURLHttps

List of usage examples for twitter4j User getProfileImageURLHttps

Introduction

In this page you can find the example usage for twitter4j User getProfileImageURLHttps.

Prototype

String getProfileImageURLHttps();

Source Link

Usage

From source file:net.nokok.twitduke.core.twitter.TwitterNotificationListener.java

License:Open Source License

/**
 * {@code Optional.}//from   ww w.j  av  a2s .co  m
 *
 * @param source
 * @param target
 * @param favoritedStatus
 */
@Override
public void onFavorite(User source, User target, Status favoritedStatus) {
    new NotificationFrame(source.getScreenName() + "???????", favoritedStatus.getText(),
            stringToURL(source.getProfileImageURLHttps()));
}

From source file:org.getlantern.firetweet.model.ParcelableDirectMessage.java

License:Open Source License

public ParcelableDirectMessage(final DirectMessage message, final long account_id, final boolean is_outgoing) {
    this.account_id = account_id;
    this.is_outgoing = is_outgoing;
    final User sender = message.getSender(), recipient = message.getRecipient();
    final String sender_profile_image_url = sender != null ? sender.getProfileImageUrlHttps() : null;
    final String recipient_profile_image_url = recipient != null ? recipient.getProfileImageUrlHttps() : null;
    id = message.getId();/* w  ww.j a  v a2  s. c  om*/
    timestamp = getTime(message.getCreatedAt());
    sender_id = sender != null ? sender.getId() : -1;
    recipient_id = recipient != null ? recipient.getId() : -1;
    text_html = TwitterContentUtils.formatDirectMessageText(message);
    text_plain = message.getText();
    sender_name = sender != null ? sender.getName() : null;
    recipient_name = recipient != null ? recipient.getName() : null;
    sender_screen_name = sender != null ? sender.getScreenName() : null;
    recipient_screen_name = recipient != null ? recipient.getScreenName() : null;
    this.sender_profile_image_url = sender_profile_image_url;
    this.recipient_profile_image_url = recipient_profile_image_url;
    text_unescaped = toPlainText(text_html);
    media = ParcelableMedia.fromEntities(message);
}

From source file:org.getlantern.firetweet.model.ParcelableStatus.java

License:Open Source License

public ParcelableStatus(final Status orig, final long account_id, final boolean is_gap) {
    this.is_gap = is_gap;
    this.account_id = account_id;
    id = orig.getId();/* www  .ja  va  2  s.  c o  m*/
    timestamp = getTime(orig.getCreatedAt());

    final Status retweeted = orig.getRetweetedStatus();
    final User retweet_user = retweeted != null ? orig.getUser() : null;
    is_retweet = orig.isRetweet();
    retweet_id = retweeted != null ? retweeted.getId() : -1;
    retweet_timestamp = retweeted != null ? getTime(retweeted.getCreatedAt()) : -1;
    retweeted_by_id = retweet_user != null ? retweet_user.getId() : -1;
    retweeted_by_name = retweet_user != null ? retweet_user.getName() : null;
    retweeted_by_screen_name = retweet_user != null ? retweet_user.getScreenName() : null;
    retweeted_by_profile_image = retweet_user != null ? retweet_user.getProfileImageUrlHttps() : null;

    final Status quoted = orig.getQuotedStatus();
    final User quote_user = quoted != null ? orig.getUser() : null;
    is_quote = orig.isQuote();
    quote_id = quoted != null ? quoted.getId() : -1;
    quote_text_html = TwitterContentUtils.formatStatusText(orig);
    quote_text_plain = orig.getText();
    quote_text_unescaped = HtmlEscapeHelper.toPlainText(quote_text_html);
    quote_timestamp = orig.getCreatedAt().getTime();
    quote_source = orig.getSource();

    quoted_by_user_id = quote_user != null ? quote_user.getId() : -1;
    quoted_by_user_name = quote_user != null ? quote_user.getName() : null;
    quoted_by_user_screen_name = quote_user != null ? quote_user.getScreenName() : null;
    quoted_by_user_profile_image = quote_user != null ? quote_user.getProfileImageUrlHttps() : null;
    quoted_by_user_is_protected = quote_user != null && quote_user.isProtected();
    quoted_by_user_is_verified = quote_user != null && quote_user.isVerified();

    final Status status;
    if (quoted != null) {
        status = quoted;
    } else if (retweeted != null) {
        status = retweeted;
    } else {
        status = orig;
    }
    final User user = status.getUser();
    user_id = user.getId();
    user_name = user.getName();
    user_screen_name = user.getScreenName();
    user_profile_image_url = user.getProfileImageUrlHttps();
    user_is_protected = user.isProtected();
    user_is_verified = user.isVerified();
    user_is_following = user.isFollowing();
    text_html = TwitterContentUtils.formatStatusText(status);
    media = ParcelableMedia.fromEntities(status);
    text_plain = status.getText();
    retweet_count = status.getRetweetCount();
    favorite_count = status.getFavoriteCount();
    reply_count = status.getReplyCount();
    descendent_reply_count = status.getDescendentReplyCount();
    in_reply_to_name = TwitterContentUtils.getInReplyToName(status);
    in_reply_to_screen_name = status.getInReplyToScreenName();
    in_reply_to_status_id = status.getInReplyToStatusId();
    in_reply_to_user_id = status.getInReplyToUserId();
    source = status.getSource();
    location = ParcelableLocation.fromGeoLocation(status.getGeoLocation());
    is_favorite = status.isFavorited();
    text_unescaped = HtmlEscapeHelper.toPlainText(text_html);
    my_retweet_id = retweeted_by_id == account_id ? id : status.getCurrentUserRetweet();
    is_possibly_sensitive = status.isPossiblySensitive();
    mentions = ParcelableUserMention.fromUserMentionEntities(status.getUserMentionEntities());
    card = ParcelableCardEntity.fromCardEntity(status.getCard(), account_id);
    place_full_name = getPlaceFullName(status.getPlace());
    card_name = card != null ? card.name : null;
}

From source file:org.getlantern.firetweet.model.ParcelableUser.java

License:Open Source License

public ParcelableUser(final User user, final long account_id, final long position) {
    this.position = position;
    this.account_id = account_id;
    final URLEntity[] urls_url_entities = user.getURLEntities();
    id = user.getId();//  w w w. j a v a  2 s .  c  o  m
    created_at = user.getCreatedAt().getTime();
    is_protected = user.isProtected();
    is_verified = user.isVerified();
    name = user.getName();
    screen_name = user.getScreenName();
    description_plain = user.getDescription();
    description_html = TwitterContentUtils.formatUserDescription(user);
    description_expanded = TwitterContentUtils.formatExpandedUserDescription(user);
    description_unescaped = HtmlEscapeHelper.toPlainText(description_html);
    location = user.getLocation();
    profile_image_url = user.getProfileImageUrlHttps();
    profile_banner_url = user.getProfileBannerImageUrl();
    url = user.getURL();
    url_expanded = url != null && urls_url_entities != null && urls_url_entities.length > 0
            ? urls_url_entities[0].getExpandedURL()
            : null;
    is_follow_request_sent = user.isFollowRequestSent();
    followers_count = user.getFollowersCount();
    friends_count = user.getFriendsCount();
    statuses_count = user.getStatusesCount();
    favorites_count = user.getFavouritesCount();
    listed_count = user.getListedCount();
    is_following = user.isFollowing();
    background_color = ParseUtils.parseColor("#" + user.getProfileBackgroundColor(), 0);
    link_color = ParseUtils.parseColor("#" + user.getProfileLinkColor(), 0);
    text_color = ParseUtils.parseColor("#" + user.getProfileTextColor(), 0);
    is_cache = false;
    is_basic = false;
}

From source file:org.getlantern.firetweet.model.ParcelableUserList.java

License:Open Source License

public ParcelableUserList(final UserList list, final long account_id, final long position,
        final boolean is_following) {
    final User user = list.getUser();
    this.position = position;
    this.account_id = account_id;
    id = list.getId();//from  w  w w .  j  a  v  a 2 s.c  o m
    is_public = list.isPublic();
    this.is_following = is_following;
    name = list.getName();
    description = list.getDescription();
    user_id = user.getId();
    user_name = user.getName();
    user_screen_name = user.getScreenName();
    user_profile_image_url = user.getProfileImageUrlHttps();
    members_count = list.getMemberCount();
    subscribers_count = list.getSubscriberCount();
}

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

License:Open Source License

public static ContentValues createAccount(final Configuration conf, final String basicUsername,
        final String basicPassword, final User user, final int color, final String apiUrlFormat,
        final boolean noVersionSuffix) {
    if (user == null || user.getId() <= 0)
        return null;
    final ContentValues values = new ContentValues();
    if (basicUsername == null || basicPassword == null)
        return null;
    values.put(Accounts.BASIC_AUTH_USERNAME, basicUsername);
    values.put(Accounts.BASIC_AUTH_PASSWORD, basicPassword);
    values.put(Accounts.AUTH_TYPE, Accounts.AUTH_TYPE_BASIC);
    values.put(Accounts.ACCOUNT_ID, user.getId());
    values.put(Accounts.SCREEN_NAME, user.getScreenName());
    values.put(Accounts.NAME, user.getName());
    values.put(Accounts.PROFILE_IMAGE_URL, user.getProfileImageUrlHttps());
    values.put(Accounts.PROFILE_BANNER_URL, user.getProfileBannerImageUrl());
    values.put(Accounts.COLOR, color);/*  www  .j  ava2s  .  co m*/
    values.put(Accounts.IS_ACTIVATED, 1);
    values.put(Accounts.API_URL_FORMAT, apiUrlFormat);
    values.put(Accounts.NO_VERSION_SUFFIX, noVersionSuffix);
    return values;
}

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

License:Open Source License

public static ContentValues createAccount(final Configuration conf, final AccessToken accessToken,
        final User user, final int authType, final int color, final String apiUrlFormat,
        final boolean sameOAuthSigningUrl, final boolean noVersionSuffix) {
    if (user == null || user.getId() <= 0 || accessToken == null || user.getId() != accessToken.getUserId())
        return null;
    final ContentValues values = new ContentValues();
    values.put(Accounts.OAUTH_TOKEN, accessToken.getToken());
    values.put(Accounts.OAUTH_TOKEN_SECRET, accessToken.getTokenSecret());
    values.put(Accounts.CONSUMER_KEY, conf.getOAuthConsumerKey());
    values.put(Accounts.CONSUMER_SECRET, conf.getOAuthConsumerSecret());
    values.put(Accounts.AUTH_TYPE, authType);
    values.put(Accounts.ACCOUNT_ID, user.getId());
    values.put(Accounts.SCREEN_NAME, user.getScreenName());
    values.put(Accounts.NAME, user.getName());
    values.put(Accounts.PROFILE_IMAGE_URL, user.getProfileImageUrlHttps());
    values.put(Accounts.PROFILE_BANNER_URL, user.getProfileBannerImageUrl());
    values.put(Accounts.COLOR, color);/*w  ww  .  j av a 2  s  .c  o m*/
    values.put(Accounts.IS_ACTIVATED, 1);
    values.put(Accounts.API_URL_FORMAT, apiUrlFormat);
    values.put(Accounts.SAME_OAUTH_SIGNING_URL, sameOAuthSigningUrl);
    values.put(Accounts.NO_VERSION_SUFFIX, noVersionSuffix);
    return values;
}

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

License:Open Source License

public static ContentValues createAccount(final Configuration conf, final User user, final int color,
        final String apiUrlFormat, final boolean noVersionSuffix) {
    if (user == null || user.getId() <= 0)
        return null;
    final ContentValues values = new ContentValues();
    values.put(Accounts.AUTH_TYPE, Accounts.AUTH_TYPE_TWIP_O_MODE);
    values.put(Accounts.ACCOUNT_ID, user.getId());
    values.put(Accounts.SCREEN_NAME, user.getScreenName());
    values.put(Accounts.NAME, user.getName());
    values.put(Accounts.PROFILE_IMAGE_URL, (user.getProfileImageUrlHttps()));
    values.put(Accounts.PROFILE_BANNER_URL, (user.getProfileBannerImageUrl()));
    values.put(Accounts.COLOR, color);/*www . j  a  v  a  2 s  .c  om*/
    values.put(Accounts.IS_ACTIVATED, 1);
    values.put(Accounts.API_URL_FORMAT, apiUrlFormat);
    values.put(Accounts.NO_VERSION_SUFFIX, noVersionSuffix);
    return values;
}

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

License:Open Source License

public static ContentValues createCachedUser(final User user) {
    if (user == null || user.getId() <= 0)
        return null;
    final String profile_image_url = user.getProfileImageUrlHttps();
    final String url = user.getURL();
    final URLEntity[] urls = user.getURLEntities();
    final ContentValues values = new ContentValues();
    values.put(CachedUsers.USER_ID, user.getId());
    values.put(CachedUsers.NAME, user.getName());
    values.put(CachedUsers.SCREEN_NAME, user.getScreenName());
    values.put(CachedUsers.PROFILE_IMAGE_URL, profile_image_url);
    values.put(CachedUsers.PROFILE_BANNER_URL, user.getProfileBannerImageUrl());
    values.put(CachedUsers.CREATED_AT, user.getCreatedAt().getTime());
    values.put(CachedUsers.IS_PROTECTED, user.isProtected());
    values.put(CachedUsers.IS_VERIFIED, user.isVerified());
    values.put(CachedUsers.IS_FOLLOWING, user.isFollowing());
    values.put(CachedUsers.FAVORITES_COUNT, user.getFavouritesCount());
    values.put(CachedUsers.FOLLOWERS_COUNT, user.getFollowersCount());
    values.put(CachedUsers.FRIENDS_COUNT, user.getFriendsCount());
    values.put(CachedUsers.STATUSES_COUNT, user.getStatusesCount());
    values.put(CachedUsers.LISTED_COUNT, user.getListedCount());
    values.put(CachedUsers.LOCATION, user.getLocation());
    values.put(CachedUsers.DESCRIPTION_PLAIN, user.getDescription());
    values.put(CachedUsers.DESCRIPTION_HTML, TwitterContentUtils.formatUserDescription(user));
    values.put(CachedUsers.DESCRIPTION_EXPANDED, TwitterContentUtils.formatExpandedUserDescription(user));
    values.put(CachedUsers.URL, url);
    if (url != null && urls != null && urls.length > 0) {
        values.put(CachedUsers.URL_EXPANDED, urls[0].getExpandedURL());
    }/*from w  w w.ja  v a  2 s .  co m*/
    values.put(CachedUsers.BACKGROUND_COLOR, ParseUtils.parseColor("#" + user.getProfileBackgroundColor(), 0));
    values.put(CachedUsers.LINK_COLOR, ParseUtils.parseColor("#" + user.getProfileLinkColor(), 0));
    values.put(CachedUsers.TEXT_COLOR, ParseUtils.parseColor("#" + user.getProfileTextColor(), 0));
    return values;
}

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

License:Open Source License

public static ContentValues createDirectMessage(final DirectMessage message, final long accountId,
        final boolean isOutgoing) {
    if (message == null)
        return null;
    final ContentValues values = new ContentValues();
    final User sender = message.getSender(), recipient = message.getRecipient();
    if (sender == null || recipient == null)
        return null;
    final String sender_profile_image_url = sender.getProfileImageUrlHttps();
    final String recipient_profile_image_url = recipient.getProfileImageUrlHttps();
    values.put(DirectMessages.ACCOUNT_ID, accountId);
    values.put(DirectMessages.MESSAGE_ID, message.getId());
    values.put(DirectMessages.MESSAGE_TIMESTAMP, message.getCreatedAt().getTime());
    values.put(DirectMessages.SENDER_ID, sender.getId());
    values.put(DirectMessages.RECIPIENT_ID, recipient.getId());
    if (isOutgoing) {
        values.put(DirectMessages.CONVERSATION_ID, recipient.getId());
    } else {/* w  ww  . j  av  a 2s.  c o m*/
        values.put(DirectMessages.CONVERSATION_ID, sender.getId());
    }
    final String text_html = TwitterContentUtils.formatDirectMessageText(message);
    values.put(DirectMessages.TEXT_HTML, text_html);
    values.put(DirectMessages.TEXT_PLAIN, message.getText());
    values.put(DirectMessages.TEXT_UNESCAPED, toPlainText(text_html));
    values.put(DirectMessages.IS_OUTGOING, isOutgoing);
    values.put(DirectMessages.SENDER_NAME, sender.getName());
    values.put(DirectMessages.SENDER_SCREEN_NAME, sender.getScreenName());
    values.put(DirectMessages.RECIPIENT_NAME, recipient.getName());
    values.put(DirectMessages.RECIPIENT_SCREEN_NAME, recipient.getScreenName());
    values.put(DirectMessages.SENDER_PROFILE_IMAGE_URL, sender_profile_image_url);
    values.put(DirectMessages.RECIPIENT_PROFILE_IMAGE_URL, recipient_profile_image_url);
    final ParcelableMedia[] mediaArray = ParcelableMedia.fromEntities(message);
    if (mediaArray != null) {
        values.put(DirectMessages.MEDIA_LIST, SimpleValueSerializer.toSerializedString(mediaArray));
    }
    return values;
}