I still don't get why
{
"date": "2025-09-21T15:09:28.613Z",
"url": "https:\/\/alceawis.com\/notice\/AyR0IiRAkqKPtCQmWm",
"preview": "https:\/\/www.videogameschronicle.com\/news\/sonic-racing-crossworlds-final-dlc-racer-is-another-classic-video-game-character",
"mode": "html",
"mediaType": "text\/html",
"isReply": false,
"replyTo": null,
"replyLocalId": null,
"mentionUsed": null,
"visibility": "public",
"alceaId": 5203
},
Matches both
https://www.videogameschronicle.com/news/sonic-racing-crossworlds-final-dlc-racer-is-another-classic-video-game-character/And
https://www.videogameschronicle.com/news/sonic-racing-crossworlds-is-getting-a-single-player-demo-next-week/via
---------
function check_social_match($article_link, $social_data) {
foreach ($social_data as $social_item) {
$preview_url = $social_item['preview'];
if (preg_match('/[^a-zA-Z0-9\/]$/', $preview_url)) {
if (strpos($article_link, $preview_url) === 0) {
return $social_item['url'];
}
} else {
$pattern = '#^' . preg_quote(rtrim($preview_url, '/'), '#') . '/?$#';
if (preg_match($pattern, $article_link)) {
return $social_item['url'];
}
if (strpos($article_link, $preview_url) === 0) {
return $social_item['url'];
}
}
}
return false;
}
---------
Sometimes :json: confuses me :confuseddog:
Making it more lax matches more false positives,
more steict and we loose some.
Sigh
Ohwell
At least
nintendonews.eu kinda works now..
What a drag
#BrokenCode #CodeAlcea #code #programming #php #js#repost •acws
#acws