Ver Fonte

More Sport filters

Xen há 1 ano atrás
pai
commit
43337311ff
1 ficheiros alterados com 51 adições e 19 exclusões
  1. 51 19
      www/index.php

+ 51 - 19
www/index.php

@@ -101,35 +101,67 @@ function clean_str($str) {
 	</p>
 	
 	<?php
+
+	// A list of all the keyworks to trigger Sports-style
 	$title_filters = array(
-			" SPORTS",
-			" NFL",
-			" NBA",
-			" MLB",
-			"ESPN"
-		);
+		"NFL",
+		"APFL",
+		"AAFL",
+		"AFL",
+		"AIFA",
+		"CFL",
+		"CIFL",
+		"IFL",
+		"IWFL",
+		"NFLE",
+		"NIFL",
+		"XFL",
+		"NBA",
+		"MLB",
+		"NHL",
+		"MMA",
+
+		"ESPN",
+		"SPORTS",
+		"Fox Sports",
+		"Yahoo Sports",
+		"NBC Sports",
+		"CBS Sports",
+		"KSL Sports",
+		"Big Ten Network",
+		"The Athletic",
+		"Sports Illustrated",
+		"Sporting News",
+		"Bleacher Report",
+		"Dowgnation",
+		"247Sports",
+
+		"FOOTBALL",
+		"Football",
+		"BASKETBALL",
+		"Basketball",
+		"HOCKEY",
+		"Hockey"
+	);
+	
+	// A list of all the title keywords. If any  
+	$description_filters = array(
+	);
+	
 	/*
 	Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
 	*/
 	foreach ($feed->get_items() as $item):
 		$item_title = clean_str($item->get_title());
 		$item_link = "article.php?loc=" . $loc . '&a=' . $item->get_permalink();
+		$subheadlines = clean_str($item->get_description());
 		
-		$up_title = strtoupper($item_title);
-		// if (str_contains($up_title, "SPORTS") == true)
-		// { 
-		// 	// 🧒 👦 👨‍👦‍👦
-		// 	echo '<p class="sports" style="font-size: 4px;">
-		// 		⚽ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏆 🏟 ⛹️
-		// 		<a href="$item_link">happened</a>
-		// 		</p>'; 
-		// 	// Break out of 2nd-level loop.
-		// 	continue;
-		// }
+		$up_title = $item_title; // strtoupper($item_title);
+		$up_description = $subheadlines; // strtoupper($subheadlines);
 		for ($i = 0; $i < count($title_filters); $i++)
 		{
-			$testing = $title_filters[$i];
-			if (str_contains($up_title, $testing) == true)
+			if (str_contains($up_title, $title_filters[$i]) == true ||
+				str_contains($up_description, $title_filters[$i]) == true)
 			{
 				// 🧒 👦 👨‍👦‍👦
 				echo '<p class="sports" style="font-size: 4px;">