Skip to content

Commit

Permalink
Update YouTube Synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschucki committed Jan 3, 2025
1 parent 1fd8fba commit 77055f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 15 additions & 8 deletions app/Http/Controllers/StatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@

class StatController extends Controller
{

/**
* @var string[]
* */
public const YOUTUBE_SYNONYMS = [
'youtube.com',
'www.youtube.com',
'youtu.be',
'm.youtube.com',
'music.youtube.com',
'youtube-nocookie.com',
'www.youtube-nocookie.com',
];

public function __invoke(Request $request)
{
return Inertia::render('Stats', [
Expand All @@ -30,14 +44,7 @@ private function getStats()
return parse_url($item->url, PHP_URL_HOST);
});

$synonyms = [
[
'youtube.com',
'www.youtube.com',
'youtu.be',
'm.youtube.com',
],
];
$synonyms = self::YOUTUBE_SYNONYMS;

foreach ($synonyms as $synonym) {
$mainDomain = $synonym[0];
Expand Down
2 changes: 2 additions & 0 deletions resources/js/Pages/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ defineProps({
<li>www.youtube.com</li>
<li>youtu.be</li>
<li>m.youtube.com</li>
<li>music.youtube.com</li>
<li>youtube-nocookie.com</li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 77055f5

Please sign in to comment.