List of usage examples for twitter4j User getProfileBackgroundImageURL
String getProfileBackgroundImageURL();
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);/* w w w . j a va 2 s . co m*/ } } struct.put("WithheldInCountries", withheldInCountries); }
From source file:com.rowland.hashtrace.utility.Utility.java
License:Apache License
public static Tweet createTweet(Status status) { User user = status.getUser(); long tweet_id = status.getId(); String tweet_text = status.getText(); Date tweet_text_date = status.getCreatedAt(); int tweet_retweet_count = status.getRetweetCount(); int tweet_favourite_count = status.getFavoriteCount(); int tweet_mentions_count = status.getUserMentionEntities().length; String user_name = user.getScreenName(); String user_image_url = user.getBiggerProfileImageURL(); String user_cover_url = user.getProfileBackgroundImageURL(); String user_location = user.getLocation(); String user_description = user.getDescription(); Tweet tweet = new Tweet(tweet_id, tweet_text, tweet_text_date, tweet_retweet_count, tweet_favourite_count, tweet_mentions_count, user_name, user_image_url, user_location, user_description, user_cover_url); return tweet; }
From source file:org.soluvas.buzz.twitter.TwitterUser.java
License:Apache License
/** * Clones attributes from Twitter4j's {@link User}. * @param src//from ww w .j a v a2 s. c om */ public TwitterUser(User src, int revId, DateTime fetchTime) { super(); this.revId = revId; this.fetchTime = fetchTime; id = src.getId(); name = src.getName(); screenName = src.getScreenName(); location = src.getLocation(); description = src.getDescription(); contributorsEnabled = src.isContributorsEnabled(); profileImageUrl = src.getProfileImageURL(); biggerProfileImageUrl = src.getBiggerProfileImageURL(); miniProfileImageUrl = src.getMiniProfileImageURL(); originalProfileImageUrl = src.getOriginalProfileImageURL(); profileImageUrlHttps = src.getProfileImageURLHttps(); biggerProfileImageUrlHttps = src.getBiggerProfileImageURLHttps(); miniProfileImageUrlHttps = src.getMiniProfileImageURLHttps(); originalProfileImageUrlHttps = src.getOriginalProfileImageURLHttps(); url = src.getURL(); protectedState = src.isProtected(); followersCount = src.getFollowersCount(); status = src.getStatus(); profileBackgroundColor = src.getProfileBackgroundColor(); profileTextColor = src.getProfileTextColor(); profileLinkColor = src.getProfileLinkColor(); profileSidebarFillColor = src.getProfileSidebarFillColor(); profileSidebarBorderColor = src.getProfileSidebarBorderColor(); profileUseBackgroundImage = src.isProfileUseBackgroundImage(); showAllInlineMedia = src.isShowAllInlineMedia(); friendsCount = src.getFriendsCount(); createdAt = new DateTime(src.getCreatedAt()); favouritesCount = src.getFavouritesCount(); utcOffset = src.getUtcOffset(); timeZone = src.getTimeZone(); profileBackgroundImageUrl = src.getProfileBackgroundImageURL(); profileBackgroundImageUrlHttps = src.getProfileBackgroundImageUrlHttps(); profileBannerUrl = src.getProfileBannerURL(); profileBannerRetinaUrl = src.getProfileBannerRetinaURL(); profileBannerIpadUrl = src.getProfileBannerIPadURL(); profileBannerIpadRetinaUrl = src.getProfileBannerIPadRetinaURL(); profileBannerMobileUrl = src.getProfileBannerMobileURL(); profileBannerMobileRetinaUrl = src.getProfileBannerMobileRetinaURL(); profileBackgroundTiled = src.isProfileBackgroundTiled(); lang = src.getLang(); statusesCount = src.getStatusesCount(); geoEnabled = src.isGeoEnabled(); verified = src.isVerified(); translator = src.isTranslator(); listedCount = src.getListedCount(); followRequestSent = src.isFollowRequestSent(); }
From source file:org.xmlsh.twitter.util.TwitterWriter.java
License:BSD License
private void write(String localName, User user) throws XMLStreamException { startElement("user"); attribute("created-at", user.getCreatedAt()); attribute("description", user.getDescription()); attribute("favorites-count", user.getFavouritesCount()); user.getFollowersCount();/*w w w. j a va2 s . c o m*/ user.getFriendsCount(); attribute("id", sanitizeID(user.getId())); attribute("lang", user.getLang()); user.getListedCount(); attribute("name", sanitizeUser(user.getName())); user.getProfileBackgroundColor(); user.getProfileBackgroundImageUrl(); user.getProfileBackgroundImageUrlHttps(); user.getProfileImageURL(); user.getProfileImageUrlHttps(); user.getProfileLinkColor(); user.getProfileSidebarBorderColor(); user.getProfileTextColor(); user.getRateLimitStatus(); attribute("screen-name", sanitizeUser(user.getScreenName())); user.getStatusesCount(); user.getTimeZone(); user.getURL(); user.getUtcOffset(); write("location", user.getLocation()); write("user-status", user.getStatus()); endElement(); }
From source file:twitbak.TwitBak.java
License:Open Source License
/** * Returns a JSONObject containing user data. * @param user/* w w w. ja v a 2s .c o m*/ * @return * @throws TwitterException * @throws JSONException */ //TODO - should be void to match other Bak classes static JSONObject userToJson(User user) throws TwitterException, JSONException { JSONObject result = new JSONObject(); JSONObject userData = new JSONObject(); userData.put("ID", user.getId()); userData.put("Screen Name", user.getScreenName()); userData.put("Name", user.getName()); userData.put("Description", user.getDescription()); userData.put("Profile Image URL", user.getProfileImageURL()); userData.put("URL", user.getURL()); userData.put("Protected", user.isProtected()); userData.put("Followers", user.getFollowersCount()); userData.put("Created At", user.getCreatedAt().toString()); userData.put("Favorites", user.getFavouritesCount()); userData.put("Friends", user.getFriendsCount()); userData.put("Location", user.getLocation()); userData.put("Statuses", user.getStatusesCount()); userData.put("Profile Background Color", user.getProfileBackgroundColor()); userData.put("Profile Background Image URL", user.getProfileBackgroundImageUrl()); userData.put("Profile Sidebar Border Color", user.getProfileSidebarBorderColor()); userData.put("Profile Sidebar Fill Color", user.getProfileSidebarFillColor()); userData.put("Profile Text Color", user.getProfileTextColor()); userData.put("Time Zone", user.getTimeZone()); result.put("User data", userData); return result; }
From source file:TwitterLookUpUsers.LookupUsers.java
License:Apache License
public static void main(String[] args) throws InterruptedException { Postgresql.DBBaglan();//from ww w . j a v a2s .c o m Postgresql.DBSelect(); Twitter twitter = new TwitterFactory().getInstance(); for (int j = 0; j < sonuc.length; j++) { try { User user = twitter.showUser(sonuc[j]); if (user.getStatus() != null) { System.out.println((j + 1) + ". Sorgu___________________________________"); System.out.println("@" + user.getScreenName()); System.out.println(user.getTimeZone()); System.out.println("@" + user.getName()); System.out.println("@" + user.getURL()); System.out.println("LOKASYONN : " + user.getLocation()); System.out.println("@" + user.getDescription()); System.out.println("@" + user.getOriginalProfileImageURL()); System.out.println("@" + user.getMiniProfileImageURL()); System.out.println("@" + user.getProfileBackgroundImageURL()); System.out.println("_______________________________________________"); if (lokasyon[j].contains(user.getLocation())) { System.out.println("KULLANICI BU OLABLR*************************"); } } else { // the user is protected System.out.println((j + 1) + ". Sorgu______________________________________"); System.out.println("@" + user.getScreenName() + "---- KULLANICI PUBLIC DEL"); System.out.println("___________________________________________________"); } } catch (TwitterException te) { te.printStackTrace(); if ((te.getErrorCode() == 88)) { System.err.println("EXCEED.............."); Thread.sleep(900000); //wait 15 min } System.out.println(); } } System.exit(0); }