digitalmethodsinitiative / dmi-tcat

Digital Methods Initiative - Twitter Capture and Analysis Toolset
Apache License 2.0
367 stars 114 forks source link

Limit number of tweets collected with timeline.php #261

Closed johannessweater closed 7 years ago

johannessweater commented 7 years ago

Hi -- I have a list of 5,600 user ids that I want to get the user Location fields for. Is it possible to set a limit in the timeline.php script so that I only retrieve their latest tweet (and with it, I'm hoping, their metadata)? I'm reluctant to try to capture all 3,200 of the latest tweets for that many users.

ErikBorra commented 7 years ago

On https://github.com/digitalmethodsinitiative/dmi-tcat/blob/master/capture/user/timeline.php#L150 you can add something like this:

if(count($tweet_ids)>100) continue;
yarine29 commented 4 years ago

i just tried this to limit tweets to 10 per user but got the following error message

PHP Fatal error: 'continue' not in the 'loop' or 'switch' context in /var/www/dmi-tcat/capture/user/timeline.php on line 152

i can't figure out where to put the count limit in the current version of timeline.php