@@ -696,14 +696,19 @@ def tweet(T, tweet_id, outfile, pretty):
696696@click .option (
697697 "--limit" ,
698698 default = 0 ,
699- help = "Maximum number of followers to save. Increments of 1000." ,
699+ help = "Maximum number of followers to save. Increments of 1000 or --max-results if set." ,
700+ )
701+ @click .option (
702+ "--max-results" ,
703+ default = 1000 ,
704+ help = "Maximum number of users per page. Default is 1000." ,
700705)
701706@command_line_progressbar_option
702707@click .argument ("user" , type = str )
703708@click .argument ("outfile" , type = click .File ("w" ), default = "-" )
704709@click .pass_obj
705710@cli_api_error
706- def followers (T , user , outfile , limit , hide_progress ):
711+ def followers (T , user , outfile , limit , max_results , hide_progress ):
707712 """
708713 Get the followers for a given user.
709714 """
@@ -720,7 +725,7 @@ def followers(T, user, outfile, limit, hide_progress):
720725 lookup_total = target_user ["public_metrics" ]["followers_count" ]
721726
722727 with tqdm (disable = hide_progress , total = lookup_total ) as progress :
723- for result in T .followers (user , user_id = user_id ):
728+ for result in T .followers (user , user_id = user_id , max_results = max_results ):
724729 _write (result , outfile )
725730 count += len (result ["data" ])
726731 progress .update (len (result ["data" ]))
@@ -731,14 +736,21 @@ def followers(T, user, outfile, limit, hide_progress):
731736
732737@twarc2 .command ("following" )
733738@click .option (
734- "--limit" , default = 0 , help = "Maximum number of friends to save. Increments of 1000."
739+ "--limit" ,
740+ default = 0 ,
741+ help = "Maximum number of friends to save. Increments of 1000 or --max-results if set." ,
742+ )
743+ @click .option (
744+ "--max-results" ,
745+ default = 1000 ,
746+ help = "Maximum number of users per page. Default is 1000." ,
735747)
736748@command_line_progressbar_option
737749@click .argument ("user" , type = str )
738750@click .argument ("outfile" , type = click .File ("w" ), default = "-" )
739751@click .pass_obj
740752@cli_api_error
741- def following (T , user , outfile , limit , hide_progress ):
753+ def following (T , user , outfile , limit , max_results , hide_progress ):
742754 """
743755 Get the users that a given user is following.
744756 """
@@ -755,7 +767,7 @@ def following(T, user, outfile, limit, hide_progress):
755767 lookup_total = target_user ["public_metrics" ]["following_count" ]
756768
757769 with tqdm (disable = hide_progress , total = lookup_total ) as progress :
758- for result in T .following (user , user_id = user_id ):
770+ for result in T .following (user , user_id = user_id , max_results = max_results ):
759771 _write (result , outfile )
760772 count += len (result ["data" ])
761773 progress .update (len (result ["data" ]))
0 commit comments