Skip to content

Commit

Permalink
Allow disabling replies and/or retweets in output.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 2, 2013
1 parent 94a15fb commit f98281d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.php
Expand Up @@ -20,6 +20,14 @@
rsort($cachefnames, SORT_NUMERIC);
}

$doreplies = true;
if (isset($_REQUEST['replies']))
$doreplies = (((int) $_REQUEST['replies']) != 0);

$doretweets = true;
if (isset($_REQUEST['retweets']))
$doretweets = (((int) $_REQUEST['retweets']) != 0);

$count = 0;
if ($cachefnames !== false)
{
Expand All @@ -28,6 +36,11 @@
$obj = unserialize(file_get_contents("$cachedir/$fname"));
if ($obj !== false)
{
if (isset($obj->in_reply_to_screen_name) && (!$doreplies))
continue;
else if (isset($obj->retweeted_status) && (!$doretweets))
continue;

$data[] = $obj;
$count++;
if (($maxtweets > 0) && ($count >= $maxtweets))
Expand Down

0 comments on commit f98281d

Please sign in to comment.