Skip to content

Commit

Permalink
Fix issue #231 - following users aftering capturing their timeline no…
Browse files Browse the repository at this point in the history
…t possible
  • Loading branch information
Emile den Tex committed Oct 11, 2016
1 parent c518cff commit 183cae8
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion capture/user/timeline.php
Expand Up @@ -20,6 +20,23 @@
$type = 'timeline'; // specify 'timeline' if you want this to be a standalone bin, or 'follow' if you want to be able to continue tracking these users later on via BASE_URL/capture/index.php


///

$all_ints = true;
foreach ($user_ids as $user_id) {
if (!is_int($user_id)) {
$all_ints = false;
break;
}
}

if ($type == 'follow' && !empty($user_ids)) {
if (!$all_ints) {
echo "To lookup user tweets and keep following those users, you will need to use numeric ids in the \$user_ids array.\n";
exit(0);
}
}

if (!empty($list_name)) { // instead of specying usernames, you can also fetch usernames from a specific list in the database
$q = $dbh->prepare("SELECT list_id FROM " . $bin_name . "_lists WHERE list_name = :list_name");
$q->bindParam(":list_name", trim($list_name), PDO::PARAM_STR);
Expand Down Expand Up @@ -51,7 +68,11 @@
$ratefree = $current_key = $looped = 0;

create_bin($bin_name, $dbh);
queryManagerCreateBinFromExistingTables($bin_name, $querybin_id, $type);
if ($all_ints) {
queryManagerCreateBinFromExistingTables($bin_name, $querybin_id, $type, $user_ids);
} else {
queryManagerCreateBinFromExistingTables($bin_name, $querybin_id, $type);
}

$tweetQueue = new TweetQueue();

Expand Down

0 comments on commit 183cae8

Please sign in to comment.