Example usage for twitter4j User isGeoEnabled

List of usage examples for twitter4j User isGeoEnabled

Introduction

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

Prototype

boolean isGeoEnabled();

Source Link

Usage

From source file:au.net.moon.tUtils.TUser.java

License:Open Source License

/**
 * Create a user object from a twitter4j user.
 * //from   w  ww.  j a  v a 2 s.  c  om
 * @param twitterUser
 *            a twitter4j user object
 */
public TUser(twitter4j.User twitterUser) {
    id = twitterUser.getId();
    name = twitterUser.getName();
    screenName = twitterUser.getScreenName();
    location = twitterUser.getLocation();
    description = twitterUser.getDescription();
    if (twitterUser.getProfileImageURL() != null) {
        profileImageUrl = twitterUser.getProfileImageURL().toString();
    } else {
        profileImageUrl = "";
    }
    if (twitterUser.getURL() != null) {
        url = twitterUser.getURL().toString();
    } else {
        url = "";
    }
    createdAt = twitterUser.getCreatedAt();
    isProtected = twitterUser.isProtected();
    followersCount = twitterUser.getFollowersCount();
    // Not interested in users latest tweet, so just leave blank
    status = "";
    profileBackgroundColor = twitterUser.getProfileBackgroundColor();
    profileTextColor = twitterUser.getProfileTextColor();
    profileLinkColor = twitterUser.getProfileLinkColor();
    profileSidebarFillColor = twitterUser.getProfileSidebarFillColor();
    profileSidebarBorderColor = twitterUser.getProfileSidebarBorderColor();
    friendsCount = twitterUser.getFriendsCount();
    favouritesCount = twitterUser.getFavouritesCount();
    utcOffset = twitterUser.getUtcOffset();
    timeZone = twitterUser.getTimeZone();
    if (twitterUser.getOriginalProfileImageURL() != null) {
        profileBackgroundImageUrl = twitterUser.getOriginalProfileImageURL().toString();
    } else {
        profileBackgroundImageUrl = "";
    }
    isProfileBackgroundTiled = twitterUser.isProfileBackgroundTiled();
    statusesCount = twitterUser.getStatusesCount();
    isGeoEnabled = twitterUser.isGeoEnabled();
    isVerified = twitterUser.isVerified();
    // isFollowing = twitterUser.isFollowing();

    isContributorsEnabled = twitterUser.isContributorsEnabled();
    isProfileUseBackgroundImage = twitterUser.isProfileUseBackgroundImage();
    isShowAllInLineMedia = twitterUser.isShowAllInlineMedia();
    lang = twitterUser.getLang();
    isTranslator = twitterUser.isTranslator();
    listedCount = twitterUser.getListedCount();
    isFollowRequestSent = twitterUser.isFollowRequestSent();

    // TODO: Need to pass in the searchAPI id if I have it.
    searchAPI_userID = "";
}

From source file:br.com.porcelli.hornetq.integration.twitter.support.TweetMessageConverterSupport.java

License:Apache License

private static void buildUserData(final String prefix, final User user, ServerMessage msg) {
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_ID, read(user.getId()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_NAME, read(user.getName()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_SCREEN_NAME, read(user.getScreenName()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_LOCATION, read(user.getLocation()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_DESCRIPTION, read(user.getDescription()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_PROFILE_IMAGE_URL,
            read(user.getProfileImageURL()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_URL, read(user.getURL()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_LANG, read(user.getLang()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_PROTECTED, read(user.isProtected()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_FOLLOWERS_COUNT, read(user.getFollowersCount()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_FRIENDS_COUNT, read(user.getFriendsCount()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_CREATED_AT, read(user.getCreatedAt()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_FAVOURITES_COUNT, read(user.getFavouritesCount()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_UTC_OFFSET, read(user.getUtcOffset()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_TIME_ZONE, read(user.getTimeZone()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_STATUSES_COUNT, read(user.getStatusesCount()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_VERIFIED, read(user.isVerified()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_CONTRIBUTORS_ENABLED,
            read(user.isContributorsEnabled()));
    msg.putStringProperty(prefix + TwitterConstants.KEY_USER_GEO_ENABLED, read(user.isGeoEnabled()));
}

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. ja v  a 2  s .c  o m*/
        }
    }
    struct.put("WithheldInCountries", withheldInCountries);

}

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]));
    }//from  www  .j  ava 2s . c om
    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:edu.cmu.geolocator.coder.utils.JSON2Tweet.java

License:Apache License

public JSONTweet readLine() {
    String line;//www.  j ava 2 s. c  o m
    try {
        line = br.readLine();
    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
        return null;
    }
    if (line == null)
        return null;

    Status tweet = null;
    try {
        // parse json to object type
        tweet = DataObjectFactory.createStatus(line);
    } catch (TwitterException e) {
        System.err.println("error parsing tweet object");
        return null;
    }

    jsontweet.JSON = line;
    jsontweet.id = tweet.getId();
    jsontweet.source = tweet.getSource();
    jsontweet.text = tweet.getText();
    jsontweet.createdat = tweet.getCreatedAt();
    jsontweet.tweetgeolocation = tweet.getGeoLocation();

    User user;
    if ((user = tweet.getUser()) != null) {

        jsontweet.userdescription = user.getDescription();
        jsontweet.userid = user.getId();
        jsontweet.userlanguage = user.getLang();
        jsontweet.userlocation = user.getLocation();
        jsontweet.username = user.getName();
        jsontweet.usertimezone = user.getTimeZone();
        jsontweet.usergeoenabled = user.isGeoEnabled();

        if (user.getURL() != null) {
            String url = user.getURL().toString();

            jsontweet.userurl = url;

            String addr = url.substring(7).split("/")[0];
            String[] countrysuffix = addr.split("[.]");
            String suffix = countrysuffix[countrysuffix.length - 1];

            jsontweet.userurlsuffix = suffix;

            try {
                InetAddress address = null;//InetAddress.getByName(user.getURL().getHost());

                String generate_URL
                // =
                // "http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress="
                        = "http://www.geoplugin.net/php.gp?ip=" + address.getHostAddress();
                URL data = new URL(generate_URL);
                URLConnection yc = data.openConnection();
                BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
                String inputLine;
                String temp = "";
                while ((inputLine = in.readLine()) != null) {
                    temp += inputLine + "\n";
                }
                temp = temp.split("s:2:\"")[1].split("\"")[0];

                jsontweet.userurllocation = temp;

            } catch (Exception uhe) {
                //uhe.printStackTrace();
                jsontweet.userurllocation = null;
            }
        }
    }

    return jsontweet;

}

From source file:edu.cmu.geolocator.coder.utils.JSON2Tweet.java

License:Apache License

public static JSONTweet getJSONTweet(String JSONString) {
    JSONTweet jsontweet = new JSONTweet();
    if (JSONString == null)
        return null;

    Status tweet = null;/*w w  w  . j  ava2 s  .  co  m*/
    try {
        // parse json to object type
        tweet = DataObjectFactory.createStatus(JSONString);
    } catch (TwitterException e) {
        System.err.println("error parsing tweet object");
        return null;
    }

    jsontweet.JSON = JSONString;
    jsontweet.id = tweet.getId();
    jsontweet.source = tweet.getSource();
    jsontweet.text = tweet.getText();
    jsontweet.createdat = tweet.getCreatedAt();
    jsontweet.tweetgeolocation = tweet.getGeoLocation();

    User user;
    if ((user = tweet.getUser()) != null) {

        jsontweet.userdescription = user.getDescription();
        jsontweet.userid = user.getId();
        jsontweet.userlanguage = user.getLang();
        jsontweet.userlocation = user.getLocation();
        jsontweet.username = user.getName();
        jsontweet.usertimezone = user.getTimeZone();
        jsontweet.usergeoenabled = user.isGeoEnabled();

        if (user.getURL() != null) {
            String url = user.getURL().toString();

            jsontweet.userurl = url;

            String addr = url.substring(7).split("/")[0];
            String[] countrysuffix = addr.split("[.]");
            String suffix = countrysuffix[countrysuffix.length - 1];

            jsontweet.userurlsuffix = suffix;

            try {
                InetAddress address = null;//InetAddress.getByName(user.getURL().getHost());

                String generate_URL
                // =
                // "http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt&IpAddress="
                        = "http://www.geoplugin.net/php.gp?ip=" + address.getHostAddress();
                URL data = new URL(generate_URL);
                URLConnection yc = data.openConnection();
                BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
                String inputLine;
                String temp = "";
                while ((inputLine = in.readLine()) != null) {
                    temp += inputLine + "\n";
                }
                temp = temp.split("s:2:\"")[1].split("\"")[0];

                jsontweet.userurllocation = temp;

            } catch (Exception uhe) {
                //uhe.printStackTrace();
                jsontweet.userurllocation = null;
            }
        }
    }

    return jsontweet;

}

From source file:org.soluvas.buzz.twitter.TwitterUser.java

License:Apache License

/**
 * Clones attributes from Twitter4j's {@link User}.
 * @param src//from ww w .ja va2  s .co m
 */
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:peoplesearch.FindFriendsAndFollowers.java

public void GetFollowersIDs() {
    try {//from w ww.  jav  a  2s .  c  o  m
        // I need to pass the Person name and the TwitterID.
        //String targetname="Philip Bergkvist";
        Twitter twitter = new TwitterFactory().getInstance();
        long cursor = -1;
        IDs ids;

        ResponseList<User> users1 = null;
        ResponseList<User> users2 = null;
        System.out.println("Listing followers's ids.");

        GraphManager mgr = EmbeddedGraphManager.getInstance();

        mgr.init(new File("/usr/local/Cellar/neo4j/2.1.7/libexec/data/forlang1.db"));
        //mgr.addTwitterAccount(new TwitterAccountImpl(new Date(), "I am Studying", 13, 82, true,"Aalborg", "Philiptwoshoes", 2730631792L));
        List<TwitterAccount> twitteraccountslist;
        twitteraccountslist = null;
        twitteraccountslist = mgr.listTwitterAccounts();
        System.out.println("the number of twitter account in the neo4J DB is" + twitteraccountslist.size());
        for (TwitterAccount Twit : twitteraccountslist) {

            do {
                TwitterLimitWait tlw = new TwitterLimitWait();
                tlw.CheckLimit();

                if (0 < twitteraccountslist.size()) {
                    ids = twitter.getFollowersIDs(Twit.getScreenName(), cursor); //.getFollowersIDs(pep[0], cursor);
                    //ids = twitter.getFollowersIDs("Philiptwoshoes", cursor); //.getFollowersIDs(pep[0], cursor);
                    tlw.CheckLimit();
                    users1 = twitter.getFollowersList(Twit.getScreenName(), cursor);
                    tlw.CheckLimit();
                    users2 = twitter.getFriendsList(Twit.getScreenName(), cursor);

                } else {
                    tlw.CheckLimit();
                    ids = twitter.getFollowersIDs(cursor);

                }

                for (User user : users1) {
                    tlw.CheckLimit();
                    System.out.println("the follower called " + user.getName() + " with twitter handler "
                            + user.getScreenName());
                    String username = user.getName();
                    //mgr.addPerson(new PersonImpl(username));
                    Date Creation = user.getCreatedAt();
                    tlw.CheckLimit();
                    String descript = user.getDescription();
                    boolean empty1 = user.getDescription().isEmpty();
                    if (empty1 == true) {
                        descript = " ";
                    }
                    tlw.CheckLimit();
                    int followers = user.getFollowersCount();
                    tlw.CheckLimit();
                    int following = user.getFriendsCount();
                    boolean geo = user.isGeoEnabled();
                    String loc = user.getLocation();
                    boolean empty2 = user.getLocation().isEmpty();
                    if (empty2 == true) {
                        loc = " ";
                    }
                    String screenname = user.getScreenName();
                    boolean empty3 = user.getScreenName().isEmpty();
                    if (empty3 == true) {
                        screenname = " ";
                    }
                    tlw.CheckLimit();
                    long twitID = user.getId();

                    mgr.linkPersonToTwitterAccount(new PersonImpl(username), new TwitterAccountImpl(Creation,
                            descript, followers, following, geo, loc, screenname, twitID));
                    mgr.linkTwitterAccounts(new TwitterAccountImpl(Creation, descript, followers, following,
                            geo, loc, screenname, twitID), Twit);
                }

                System.out.println("The total number of followers is: " + users1.size());
                // the same procedure for the Following
                for (User user : users2) {
                    tlw.CheckLimit();
                    System.out.println("the following called " + user.getName() + " with twitter handler "
                            + user.getScreenName());
                    String username1 = user.getName();
                    //mgr.addPerson(new PersonImpl(username1));
                    Date Creation = user.getCreatedAt();
                    String descript = user.getDescription();
                    boolean empty1 = user.getDescription().isEmpty();
                    if (empty1 == true) {
                        descript = " ";
                    }
                    int followers = user.getFollowersCount();
                    int following = user.getFriendsCount();
                    boolean geo = user.isGeoEnabled();
                    String loc = user.getLocation();
                    boolean empty2 = user.getLocation().isEmpty();
                    if (empty2 == true) {
                        loc = " ";
                    }
                    String screenname = user.getScreenName();
                    tlw.CheckLimit();
                    boolean empty3 = user.getScreenName().isEmpty();
                    if (empty3 == true) {
                        screenname = " ";
                    }
                    tlw.CheckLimit();
                    long twitID = user.getId();
                    //mgr.addTwitterAccount(new TwitterAccountImpl(Creation,descript,followers,following,geo,loc,screenname,twitID));
                    mgr.linkPersonToTwitterAccount(new PersonImpl(username1), new TwitterAccountImpl(Creation,
                            descript, followers, following, geo, loc, screenname, twitID));
                    mgr.linkTwitterAccounts(Twit, new TwitterAccountImpl(Creation, descript, followers,
                            following, geo, loc, screenname, twitID));
                }
                System.out.println("The total number of friend is: " + users2.size());

                //}
            } while ((cursor = ids.getNextCursor()) != 0);

        }
        mgr.destroy(); // I have to check that the second iteration works fine, because i could not test that.
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to get followers' ids: " + te.getMessage());
        System.exit(-1);
    }
}

From source file:peoplesearch.SearchTwitterUsers.java

public void SearchTwitterUsers() {
    int page = 1;
    int numberofpages = 0;
    Date TwitterAccCreatedAt = new Date();
    String TwitterAccDescr = " ";
    int TwitterFollowersCount = 0;
    int TwitterFriendsCount = 0;
    boolean TwitterGeoEnabled = false;
    String TwitterLocation = " ";
    String TwiterAccScrName = " ";
    long TwitterID = 0L;

    try {// w  w  w . j a  va 2s . c om

        Twitter twitter = new TwitterFactory().getInstance();
        ResponseList<User> users;
        List<Person> people = null;
        GraphManager mgr = EmbeddedGraphManager.getInstance();
        mgr.init(new File("/usr/local/Cellar/neo4j/2.1.7/libexec/data/forlang1.db"));

        mgr.addPerson(new PersonImpl("wgaura"));
        mgr.addPerson(new PersonImpl("Derek Mizak"));
        mgr.addPerson(new PersonImpl("Swiderek"));
        mgr.addPerson(new PersonImpl("Microsoft"));
        mgr.addPerson(new PersonImpl("BBC"));
        mgr.addPerson(new PersonImpl("RTE"));
        mgr.addPerson(new PersonImpl("CNBC"));
        mgr.addPerson(new PersonImpl("Poland"));
        mgr.addPerson(new PersonImpl("Ireland"));
        mgr.addPerson(new PersonImpl("Ergo"));

        people = mgr.listPeople();

        for (Person person : people) {
            do {
                TwitterLimitWait tlw = new TwitterLimitWait();
                tlw.CheckLimit();

                users = twitter.searchUsers(person.getName(), page);
                numberofpages = users.size() / 20;

                for (User user : users) {
                    if (user.getStatus() != null) {

                        TwitterAccCreatedAt = user.getCreatedAt();
                        if (!user.getDescription().isEmpty()) {
                            TwitterAccDescr = user.getDescription();
                        }
                        //if (user.getFollowersCount()>0) {TwitterFollowersCount=user.getFavouritesCount();}
                        //if  (user.getFriendsCount()>0) {TwitterFriendsCount=user.getFriendsCount();}
                        TwitterFollowersCount = user.getFollowersCount();
                        TwitterFriendsCount = user.getFriendsCount();
                        TwitterGeoEnabled = user.isGeoEnabled();
                        if (!user.getLocation().isEmpty()) {
                            TwitterLocation = user.getLocation();
                        }
                        TwiterAccScrName = user.getScreenName();
                        TwitterID = user.getId();

                        System.out.println("@" + user.getScreenName() + " - " + TwitterFollowersCount + " _ "
                                + TwitterFriendsCount);

                        //mgr.addTwitterAccount(new TwitterAccountImpl(TwitterAccCreatedAt,TwitterAccDescr,TwitterFollowersCount,TwitterFriendsCount,TwitterGeoEnabled,TwitterLocation,TwiterAccScrName,TwitterID));
                        mgr.linkPersonToTwitterAccount(person,
                                new TwitterAccountImpl(TwitterAccCreatedAt, TwitterAccDescr,
                                        TwitterFollowersCount, TwitterFriendsCount, TwitterGeoEnabled,
                                        TwitterLocation, TwiterAccScrName, TwitterID));

                        TwitterAccDescr = " ";
                        TwitterLocation = " ";
                        TwitterFollowersCount = 0;
                        TwitterFriendsCount = 0;

                        //numberofusers++;

                    } else {
                        // the user is protected
                        System.out.println("@" + user.getScreenName());
                    }
                }

                page++;
                //System.out.println(page);
            } while (users.size() != 0 && page < numberofpages);
        }
    } catch (Exception ex) {
        System.out.println(ex.getMessage());
    }
}