diff options
Diffstat (limited to 'http')
-rw-r--r-- | http/index.php | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/http/index.php b/http/index.php index 1c0fae3..572f857 100644 --- a/http/index.php +++ b/http/index.php @@ -71,14 +71,27 @@ if ($user) { $filteredContent = []; foreach ($content as $c) { if (!in_array($c->id_str, $spamContent)) { - $urls = array_map( - function($url) { - return $url->expanded_url; - }, - $c->entities->urls + $twitterURLs = FALSE; + $urls = array_filter( + array_map( + function($url) { + return $url->expanded_url; + }, + $c->entities->urls + ), + function($url) use(&$twitterURLs) { + $urlParts = parse_url($url); + if ($urlParts['host'] == 'twitter.com') { + $twitterURLs = TRUE; + return FALSE; + } + return TRUE; + } ); if (!$urls) { - $filteredContent[] = $c; + if (!$twitterURLs) { + $filteredContent[] = $c; + } } else { sort($urls); $urlHash = md5(implode('|', $urls)); |