Usage: java twitter4j.examples.block.GetBlockingUsers

@param args message
350016
public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            int page = 1;
            List<User> users;
            do {
                users = twitter.getBlocksList(page);
                for (User user : users) {
                    System.out.println("@" + user.getScreenName());
                }
                page++;
                // this code ends up in an infinite loop due to the issue 1988
                // http://code.google.com/p/twitter-api/issues/detail?id=1988
            } while (users.size() > 0 && page <= 10);
            System.out.println("done.");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to get blocking users: " + te.getMessage());
            System.exit(-1);
        }
    }
789904
public static void main(String[] args)
    {
    	
    	// Override CQL version while instantiating entity manager factory.

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("twissandra,twingo,twirdbms");
        EntityManager em = emf.createEntityManager();

        try
        {
        	
        //populate user set from excel sheet.
        Set<User> users = UserBroker.brokeUserList(args[0]);

        for (Iterator<User> iterator = users.iterator(); iterator.hasNext();)
        {
            User user = (User) iterator.next();

            // on Persist
            ExecutorService.onPersist(em, user);
            
                 
            // on find by id.
            ExecutorService.findByKey(em,"BigDataUser");
            
            List<User> fetchedUsers = ExecutorService.onQueryByEmail(em, user);
            
            if (fetchedUsers != null && fetchedUsers.size() > 0)
            {
                logger.info(user.toString());
            }

            logger.info("");
            System.out.println("#######################Querying##########################################");
            logger.info("");
            logger.info("");

        }

        // Execute wild search query.
        String query = "Select u from User u";
        logger.info(query);
        ExecutorService.findByQuery(em, query);

        // // Execute native CQL. Fetch tweets for given user.
        logger.info("");
        System.out.println("#######################Querying##########################################");
        logger.info("");
        logger.info("");

        query = "Select * from tweets where user_id='RDBMSUser'";
        logger.info(query);
        ExecutorService.findByNativeQuery(em,query);
    	} finally
    	{
    		onDestroyDBResources(emf, em);
    	}
    }
416774
public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            List<Status> statuses = twitter.getFavorites();
            for (Status status : statuses) {
                System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
            }
            System.out.println("done.");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to get favorites: " + te.getMessage());
            System.exit(-1);
        }
    }
200866
static public void main(String[] argv) 
    {
        try {
	    Blocker blocker = (Blocker)Class.forName(BLOCKER_PACKAGE+argv[0]).newInstance();
	    StringDistanceLearner learner = DistanceLearnerFactory.build( argv[1] );
	    MatchData data = new MatchData(argv[2]);
	    MatchExpt expt = new MatchExpt(data,learner,blocker);
            for (int i=3; i<argv.length; ) {
                String c = argv[i++];
                if (c.equals("-display")) {
                    expt.displayResults(true,System.out);
                } else if (c.equals("-dump")) {
                    expt.dumpResults(System.out);
                } else if (c.equals("-shortDisplay")) {
                    expt.displayResults(false,System.out);
                } else if (c.equals("-graph")) {
                    expt.graphPrecisionRecall(System.out);
                } else if (c.equals("-summarize")) {
                    System.out.println("maxF1:\t" + expt.maxF1());
                    System.out.println("avgPrec:\t" + expt.averagePrecision());
                } else {
                    throw new RuntimeException("illegal command "+c);
                }
            }
        } catch (Exception e) {
	    e.printStackTrace();
	    System.out.println("\nusage: <blocker> <distanceClass> <matchDataFile> [commands]\n");
        }
    }
1111482
def blocked?(user)
      (blocked_friend_ids + blocked_inverse_friend_ids + blocked_pending_inverse_friend_ids).include?(user.id) or user.blocked_pending_inverse_friend_ids.include?(self.id)
    end
316575
@NotNull
    @ObjectiveCName("blockUser:")
    public Promise<Void> blockUser(int uid) {
        return modules.getUsersModule().blockUser(uid);
    }
25911
private Long getUserIdArg(Object[] arguments) {
        if (arguments.length <= USER_ID_INDEX) {
            log.error("Illegal number of args: " + arguments.length);
        }
        return (Long) arguments[USER_ID_INDEX];
    }
1262585
public void unblockUser(DomainBareJid mucLightService, Jid userJid)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        HashMap<Jid, Boolean> users = new HashMap<>();
        users.put(userJid, true);
        sendUnblockUsers(mucLightService, users);
    }
201330
public void blockUser(DomainBareJid mucLightService, Jid userJid)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        HashMap<Jid, Boolean> users = new HashMap<>();
        users.put(userJid, false);
        sendBlockUsers(mucLightService, users);
    }
514759
@Override
    public void reportSpam(final long userId) {
        getDispatcher().invokeLater(new AsyncTask(REPORT_SPAM, listeners) {
            @Override
            public void invoke(List<TwitterListener> listeners) throws TwitterException {
                User user = twitter.reportSpam(userId);
                for (TwitterListener listener : listeners) {
                    try {
                        listener.reportedSpam(user);
                    } catch (Exception e) {
                        logger.warn("Exception at reportSpam", e);
                    }
                }
            }
        });
    }
795292
static public void main(String[] argv) 
    {
        try {
	    Blocker blocker = (Blocker)Class.forName(BLOCKER_PACKAGE+argv[0]).newInstance();
	    StringDistanceLearner learner = DistanceLearnerFactory.build( argv[1] );
	    MatchData data = new MatchData(argv[2]);
            // check for options for the experiment
            boolean useTrueClusters = false;
            String moreNamesFile = null;
            String similarTokenFile = null;
            boolean untrained = false;
            for (int i=3; i<argv.length; ) {
                String c = argv[i++];
                if (c.equals("-trueClusters")) {
                    useTrueClusters = true;
                } else if (c.equals("-untrained")) {
                    untrained = true;
                } else if (c.equals("-moreNames")) {
                    moreNamesFile = argv[i++];
                } else if (c.equals("-similarTokens")) {
                    similarTokenFile = argv[i++];
                }
            }
            // run the experiment
            SpecialMatchExpt expt = new SpecialMatchExpt(data,learner,blocker,useTrueClusters,moreNamesFile,similarTokenFile,untrained);
            // print results
            for (int i=3; i<argv.length; ) {
                String c = argv[i++];
                if (c.equals("-display")) {
                    expt.displayResults(true,System.out);
                } else if (c.equals("-dump")) {
                    expt.dumpResults(System.out);
                } else if (c.equals("-shortDisplay")) {
                    expt.displayResults(false,System.out);
                } else if (c.equals("-graph")) {
                    expt.graphPrecisionRecall(System.out);
                } else if (c.equals("-summarize")) {
                    System.out.println("maxF1:\t" + expt.maxF1());
                    System.out.println("avgPrec:\t" + expt.averagePrecision());
                } else if (c.equals("-explain")) {
                    // debugging, trick 1
                    System.out.println("distance: "+expt.getLearnedDistance());
                    System.out.println("inputs: '"+argv[i]+"' and '"+argv[i+1] + "'");
                    System.out.println(expt.getLearnedDistance().explainScore(argv[i],argv[i+1]));
                    i += 2;
                } else if (c.equals("-df")) {
                    TFIDF dist = ((TFIDF)expt.getLearnedDistance());
                    dist.prepare(argv[i++]);
                    Token[] toks = dist.getTokens();
                    for (int j=0; j<toks.length; j++) {
                        System.out.println("df of "+toks[j]+" is "+dist.getDocumentFrequency(toks[j]));
                    }
                } else if (c.equals("-trueClusters") || c.equals("-untrained")) {
                    ;
                } else if (c.equals("-moreNames") || c.equals("-similarTokens")) {
                    i++;
                } else {
                    throw new RuntimeException("illegal command "+c);
                }
            }
        } catch (Exception e) {
	    e.printStackTrace();
	    System.out.println("\nusage: <blocker> <distanceClass> <matchDataFile> [commands]\n");
        }
    }
404793
public List<Jid> getUsersAndRoomsBlocked(DomainBareJid mucLightService)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);

        List<Jid> jids = new ArrayList<>();
        if (muclIghtBlockingIQResult.getRooms() != null) {
            jids.addAll(muclIghtBlockingIQResult.getRooms().keySet());
        }

        if (muclIghtBlockingIQResult.getUsers() != null) {
            jids.addAll(muclIghtBlockingIQResult.getUsers().keySet());
        }

        return jids;
    }
491722
function block(...args) {
    info('-'.repeat(80));
    args.forEach(message => info(message));
    info('-'.repeat(80));
}
336031
public void queryBlockedMembers(int offset, int limit, final AVIMConversationSimpleResultCallback callback) {
    if (null == callback) {
      return;
    } else if (offset < 0 || limit > 100) {
      callback.internalDone(null, new AVIMException(new IllegalArgumentException("offset/limit is illegal.")));
      return;
    }
    Map<String, Object> params = new HashMap<String, Object>();
    params.put(Conversation.QUERY_PARAM_LIMIT, limit);
    params.put(Conversation.QUERY_PARAM_OFFSET, offset);
    boolean ret = InternalConfiguration.getOperationTube().processMembers(this.client.getClientId(), this.conversationId,
            getType(), JSON.toJSONString(params), Conversation.AVIMOperation.CONVERSATION_BLOCKED_MEMBER_QUERY, callback);
    if (!ret) {
      callback.internalDone(null,
              new AVException(AVException.OPERATION_FORBIDDEN, "couldn't start service in background."));
    }
  }
1101629
@Override
    public ResponseList<UserList> getUserLists(String listOwnerScreenName) throws TwitterException {
        return getUserLists(listOwnerScreenName, false);
    }
1105530
public static void main(String[] args) {
        Twitter twitter = new TwitterFactory().getInstance();
        System.out.println("Saving public timeline.");
        try {
            new File("statuses").mkdir();
            List<Status> statuses = twitter.getHomeTimeline();
            for (Status status : statuses) {
                String rawJSON = TwitterObjectFactory.getRawJSON(status);
                String fileName = "statuses/" + status.getId() + ".json";
                storeJSON(rawJSON, fileName);
                System.out.println(fileName + " - " + status.getText());
            }
            System.out.print("\ndone.");
            System.exit(0);
        } catch (IOException ioe) {
            ioe.printStackTrace();
            System.out.println("Failed to store tweets: " + ioe.getMessage());
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to get timeline: " + te.getMessage());
            System.exit(-1);
        }
    }
924307
public static void main(String[] args) {
        if (args.length < 2) {
            System.out.println("Usage: java twitter4j.examples.friendship.ShowFriendship [source screen name] [target screen name]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            Relationship relationship = twitter.showFriendship(args[0], args[1]);
            System.out.println("isSourceBlockingTarget: " + relationship.isSourceBlockingTarget());
            System.out.println("isSourceFollowedByTarget: " + relationship.isSourceFollowedByTarget());
            System.out.println("isSourceFollowingByTarget: " + relationship.isSourceFollowingTarget());
            System.out.println("isSourceNotificationsEnabled: " + relationship.isSourceNotificationsEnabled());
            System.out.println("canSourceDm: " + relationship.canSourceDm());
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to show friendship: " + te.getMessage());
            System.exit(-1);
        }
    }