List of usage examples for twitter4j User isVerified
boolean isVerified();
From source file:com.github.gorbin.asne.twitter.TwitterSocialNetwork.java
License:Open Source License
private TwitterPerson getDetailedSocialPerson(TwitterPerson twitterPerson, User user) { getSocialPerson(twitterPerson, user); twitterPerson.createdDate = user.getCreatedAt().getTime(); twitterPerson.description = user.getDescription(); twitterPerson.favoritesCount = user.getFavouritesCount(); twitterPerson.followersCount = user.getFollowersCount(); twitterPerson.friendsCount = user.getFriendsCount(); twitterPerson.lang = user.getLang(); twitterPerson.location = user.getLocation(); twitterPerson.screenName = user.getScreenName(); if (user.getStatus() != null) { twitterPerson.status = user.getStatus().getText(); } else {/*www .j av a 2 s.com*/ twitterPerson.status = null; } twitterPerson.timezone = user.getTimeZone(); twitterPerson.isTranslator = user.isTranslator(); twitterPerson.isVerified = user.isVerified(); return twitterPerson; }
From source file:com.github.jcustenborder.kafka.connect.twitter.StatusConverter.java
License:Apache License
public static void convert(User user, Struct struct) { struct.put("Id", user.getId()).put("Name", user.getName()).put("ScreenName", user.getScreenName()) .put("Location", user.getLocation()).put("Description", user.getDescription()) .put("ContributorsEnabled", user.isContributorsEnabled()) .put("ProfileImageURL", user.getProfileImageURL()) .put("BiggerProfileImageURL", user.getBiggerProfileImageURL()) .put("MiniProfileImageURL", user.getMiniProfileImageURL()) .put("OriginalProfileImageURL", user.getOriginalProfileImageURL()) .put("ProfileImageURLHttps", user.getProfileImageURLHttps()) .put("BiggerProfileImageURLHttps", user.getBiggerProfileImageURLHttps()) .put("MiniProfileImageURLHttps", user.getMiniProfileImageURLHttps()) .put("OriginalProfileImageURLHttps", user.getOriginalProfileImageURLHttps()) .put("DefaultProfileImage", user.isDefaultProfileImage()).put("URL", user.getURL()) .put("Protected", user.isProtected()).put("FollowersCount", user.getFollowersCount()) .put("ProfileBackgroundColor", user.getProfileBackgroundColor()) .put("ProfileTextColor", user.getProfileTextColor()) .put("ProfileLinkColor", user.getProfileLinkColor()) .put("ProfileSidebarFillColor", user.getProfileSidebarFillColor()) .put("ProfileSidebarBorderColor", user.getProfileSidebarBorderColor()) .put("ProfileUseBackgroundImage", user.isProfileUseBackgroundImage()) .put("DefaultProfile", user.isDefaultProfile()) .put("ShowAllInlineMedia", user.isShowAllInlineMedia()).put("FriendsCount", user.getFriendsCount()) .put("CreatedAt", user.getCreatedAt()).put("FavouritesCount", user.getFavouritesCount()) .put("UtcOffset", user.getUtcOffset()).put("TimeZone", user.getTimeZone()) .put("ProfileBackgroundImageURL", user.getProfileBackgroundImageURL()) .put("ProfileBackgroundImageUrlHttps", user.getProfileBackgroundImageUrlHttps()) .put("ProfileBannerURL", user.getProfileBannerURL()) .put("ProfileBannerRetinaURL", user.getProfileBannerRetinaURL()) .put("ProfileBannerIPadURL", user.getProfileBannerIPadURL()) .put("ProfileBannerIPadRetinaURL", user.getProfileBannerIPadRetinaURL()) .put("ProfileBannerMobileURL", user.getProfileBannerMobileURL()) .put("ProfileBannerMobileRetinaURL", user.getProfileBannerMobileRetinaURL()) .put("ProfileBackgroundTiled", user.isProfileBackgroundTiled()).put("Lang", user.getLang()) .put("StatusesCount", user.getStatusesCount()).put("GeoEnabled", user.isGeoEnabled()) .put("Verified", user.isVerified()).put("Translator", user.isTranslator()) .put("ListedCount", user.getListedCount()).put("FollowRequestSent", user.isFollowRequestSent()); List<String> withheldInCountries = new ArrayList<>(); if (null != user.getWithheldInCountries()) { for (String s : user.getWithheldInCountries()) { withheldInCountries.add(s);/*from w w w . ja va 2 s .co m*/ } } struct.put("WithheldInCountries", withheldInCountries); }
From source file:com.marpies.ane.twitter.utils.UserUtils.java
License:Apache License
public static JSONObject getJSON(User user) throws JSONException { JSONObject userJSON = new JSONObject(); userJSON.put("id", user.getId()); userJSON.put("screenName", user.getScreenName()); userJSON.put("name", user.getName()); userJSON.put("createdAt", user.getCreatedAt()); userJSON.put("description", user.getDescription()); userJSON.put("tweetsCount", user.getStatusesCount()); userJSON.put("likesCount", user.getFavouritesCount()); userJSON.put("followersCount", user.getFollowersCount()); userJSON.put("friendsCount", user.getFriendsCount()); userJSON.put("profileImageURL", user.getProfileImageURL()); userJSON.put("isProtected", user.isProtected()); userJSON.put("isVerified", user.isVerified()); userJSON.put("location", user.getLocation()); return userJSON; }
From source file:com.twitstreet.db.data.Stock.java
License:Open Source License
public Stock(twitter4j.User twUser) { this.setId(twUser.getId()); this.setLongName(twUser.getName()); this.setName(twUser.getScreenName()); this.setTotal(twUser.getFollowersCount()); this.setPictureUrl(twUser.getProfileImageURL().toExternalForm()); this.setSold(0.0D); this.setVerified(twUser.isVerified()); this.setLanguage(twUser.getLang()); this.setCreatedAt(twUser.getCreatedAt()); this.setLocation(twUser.getLocation()); this.setDescription(twUser.getDescription()); }
From source file:com.twitstreet.twitter.SimpleTwitterUser.java
License:Open Source License
public SimpleTwitterUser(User user) { this.id = user.getId(); this.screenName = user.getScreenName(); this.pictureUrl = user.getProfileImageURL().toExternalForm(); this.followerCount = user.getFollowersCount(); this.verified = user.isVerified(); }
From source file:DataCollections.UserHelper.java
public User_dbo convertUserToUser_dbo(User user) { User_dbo u = new User_dbo(); u.values[User_dbo.map.get("user_id")].setValue(String.valueOf(user.getId())); u.values[User_dbo.map.get("name")].setValue(removeEscapeCharacters(user.getName())); u.values[User_dbo.map.get("screename")].setValue(removeEscapeCharacters(user.getScreenName())); u.values[User_dbo.map.get("lang")].setValue(user.getLang()); u.values[User_dbo.map.get("location")].setValue(removeEscapeCharacters(user.getLocation())); u.values[User_dbo.map.get("geoenabled")].setValue(String.valueOf(user.isGeoEnabled())); u.values[User_dbo.map.get("timezone")].setValue(user.getTimeZone()); u.values[User_dbo.map.get("profileurl")].setValue(user.getURL()); u.values[User_dbo.map.get("protected")].setValue(String.valueOf(user.isProtected())); u.values[User_dbo.map.get("verified")].setValue(String.valueOf(user.isVerified())); u.values[User_dbo.map.get("description")].setValue(removeEscapeCharacters(user.getDescription())); if (geoinfoavailable) { double[] geocoor = geohelper.searchGeoLocCoor(user.getLocation()); u.values[User_dbo.map.get("probased_geoinfo")].setValue(String.valueOf("true")); //u.values[User_dbo.map.get("descbased_geoinfo")].setValue(String.valueOf("false")); u.values[User_dbo.map.get("probased_lat")].setValue(String.valueOf(geocoor[0])); u.values[User_dbo.map.get("probased_lon")].setValue(String.valueOf(geocoor[1])); }// w w w .j ava 2 s . com u.values[User_dbo.map.get("udetails_processed")].setValue(String.valueOf(true)); u.values[User_dbo.map.get("totaltweets")].setValue(String.valueOf(user.getStatusesCount())); return u; }
From source file:de.vanita5.twittnuker.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();/* w w w . ja v a2 s . c om*/ timestamp = getTime(orig.getCreatedAt()); is_retweet = orig.isRetweet(); final Status retweeted = orig.getRetweetedStatus(); final User retweet_user = retweeted != null ? orig.getUser() : null; retweet_id = retweeted != null ? retweeted.getId() : -1; //NOTE getTime(orig.getCreatedAt()) 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 ? ParseUtils.parseString(retweet_user.getProfileImageUrlHttps()) : null; final Status status = retweeted != null ? retweeted : orig; final User user = status.getUser(); user_id = user.getId(); user_name = user.getName(); user_screen_name = user.getScreenName(); user_profile_image_url = ParseUtils.parseString(user.getProfileImageUrlHttps()); user_is_protected = user.isProtected(); user_is_verified = user.isVerified(); user_is_following = user.isFollowing(); text_html = 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 = 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 = new ParcelableLocation(status.getGeoLocation()); is_favorite = status.isFavorited(); text_unescaped = toPlainText(text_html); my_retweet_id = retweeted_by_id == account_id ? id : -1; is_possibly_sensitive = status.isPossiblySensitive(); mentions = ParcelableUserMention.fromUserMentionEntities(status.getUserMentionEntities()); first_media = media != null && media.length > 0 ? media[0].url : null; }
From source file:de.vanita5.twittnuker.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();//from w w w . java 2 s .co m created_at = getTime(user.getCreatedAt()); is_protected = user.isProtected(); is_verified = user.isVerified(); name = user.getName(); screen_name = user.getScreenName(); description_plain = user.getDescription(); description_html = formatUserDescription(user); description_expanded = formatExpandedUserDescription(user); location = user.getLocation(); profile_image_url = ParseUtils.parseString(user.getProfileImageUrlHttps()); profile_banner_url = user.getProfileBannerImageUrl(); url = ParseUtils.parseString(user.getURL()); url_expanded = url != null && urls_url_entities != null && urls_url_entities.length > 0 ? ParseUtils.parseString(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_cache = false; is_following = user.isFollowing(); description_unescaped = toPlainText(description_html); }
From source file:de.vanita5.twittnuker.util.ContentValuesCreator.java
License:Open Source License
public static ContentValues makeCachedUserContentValues(final User user) { if (user == null || user.getId() <= 0) return null; final String profile_image_url = ParseUtils.parseString(user.getProfileImageUrlHttps()); final String url = ParseUtils.parseString(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.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, Utils.formatUserDescription(user)); values.put(CachedUsers.DESCRIPTION_EXPANDED, Utils.formatExpandedUserDescription(user)); values.put(CachedUsers.URL, url); values.put(CachedUsers.URL_EXPANDED, url != null && urls != null && urls.length > 0 ? ParseUtils.parseString(urls[0].getExpandedURL()) : null);//from w w w . ja va2 s .c o m values.put(CachedUsers.PROFILE_BANNER_URL, user.getProfileBannerImageUrl()); return values; }
From source file:de.vanita5.twittnuker.util.ContentValuesCreator.java
License:Open Source License
public static ContentValues makeStatusContentValues(final Status orig, final long accountId, final boolean largeProfileImage) { if (orig == null || orig.getId() <= 0) return null; final ContentValues values = new ContentValues(); values.put(Statuses.ACCOUNT_ID, accountId); values.put(Statuses.STATUS_ID, orig.getId()); values.put(Statuses.STATUS_TIMESTAMP, orig.getCreatedAt().getTime()); values.put(Statuses.MY_RETWEET_ID, orig.getCurrentUserRetweet()); final boolean isRetweet = orig.isRetweet(); final Status status; final Status retweetedStatus = isRetweet ? orig.getRetweetedStatus() : null; if (retweetedStatus != null) { final User retweetUser = orig.getUser(); values.put(Statuses.RETWEET_ID, retweetedStatus.getId()); values.put(Statuses.RETWEET_TIMESTAMP, retweetedStatus.getCreatedAt().getTime()); values.put(Statuses.RETWEETED_BY_USER_ID, retweetUser.getId()); values.put(Statuses.RETWEETED_BY_USER_NAME, retweetUser.getName()); values.put(Statuses.RETWEETED_BY_USER_SCREEN_NAME, retweetUser.getScreenName()); values.put(Statuses.RETWEETED_BY_USER_PROFILE_IMAGE, ParseUtils.parseString(retweetUser.getProfileImageUrlHttps())); status = retweetedStatus;/*w w w.j a va 2 s . c o m*/ } else { status = orig; } final User user = status.getUser(); if (user != null) { final long userId = user.getId(); final String profileImageUrl = ParseUtils.parseString(user.getProfileImageUrlHttps()); final String name = user.getName(), screenName = user.getScreenName(); values.put(Statuses.USER_ID, userId); values.put(Statuses.USER_NAME, name); values.put(Statuses.USER_SCREEN_NAME, screenName); values.put(Statuses.IS_PROTECTED, user.isProtected()); values.put(Statuses.IS_VERIFIED, user.isVerified()); values.put(Statuses.USER_PROFILE_IMAGE_URL, largeProfileImage ? getBiggerTwitterProfileImage(profileImageUrl) : profileImageUrl); values.put(CachedUsers.IS_FOLLOWING, user.isFollowing()); } final String text_html = Utils.formatStatusText(status); values.put(Statuses.TEXT_HTML, text_html); values.put(Statuses.TEXT_PLAIN, status.getText()); values.put(Statuses.TEXT_UNESCAPED, toPlainText(text_html)); values.put(Statuses.RETWEET_COUNT, status.getRetweetCount()); values.put(Statuses.REPLY_COUNT, status.getReplyCount()); values.put(Statuses.DESCENDENT_REPLY_COUNT, status.getDescendentReplyCount()); values.put(Statuses.IN_REPLY_TO_STATUS_ID, status.getInReplyToStatusId()); values.put(Statuses.IN_REPLY_TO_USER_ID, status.getInReplyToUserId()); values.put(Statuses.IN_REPLY_TO_USER_NAME, Utils.getInReplyToName(status)); values.put(Statuses.IN_REPLY_TO_USER_SCREEN_NAME, status.getInReplyToScreenName()); values.put(Statuses.SOURCE, status.getSource()); values.put(Statuses.IS_POSSIBLY_SENSITIVE, status.isPossiblySensitive()); final GeoLocation location = status.getGeoLocation(); if (location != null) { values.put(Statuses.LOCATION, location.getLatitude() + "," + location.getLongitude()); } values.put(Statuses.IS_RETWEET, isRetweet); values.put(Statuses.IS_FAVORITE, status.isFavorited()); final ParcelableMedia[] media = ParcelableMedia.fromEntities(status); if (media != null) { values.put(Statuses.MEDIA, JSONSerializer.toJSONArrayString(media)); values.put(Statuses.FIRST_MEDIA, media[0].url); } final ParcelableUserMention[] mentions = ParcelableUserMention.fromStatus(status); if (mentions != null) { values.put(Statuses.MENTIONS, JSONSerializer.toJSONArrayString(mentions)); } return values; }