Use article IDs for permalinks and OG images
This commit is contained in:
parent
fbc4f1045a
commit
37e43b6bca
3 changed files with 168 additions and 59 deletions
|
|
@ -122,11 +122,18 @@ function try_send_show_notification($job, $jobdir, $root, $subs_file, $cache_fil
|
|||
}
|
||||
}
|
||||
|
||||
$article_id_file = $jobdir . '/.mvlog-id';
|
||||
$article_id = file_exists($article_id_file) ? strtolower(trim((string)@file_get_contents($article_id_file))) : '';
|
||||
if (!preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $article_id)) {
|
||||
error_log("[mvlog] article id missing, skipping push for $job\n", 3, $logfile);
|
||||
return false;
|
||||
}
|
||||
|
||||
$payload = json_encode([
|
||||
'title' => 'Show enabled',
|
||||
'body' => $title,
|
||||
'url' => "https://bubulescu.org/mvlog/?job=$job",
|
||||
'tag' => "mvlog-show-$job",
|
||||
'url' => './?id=' . rawurlencode($article_id),
|
||||
'tag' => "mvlog-show-$article_id",
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
|
||||
// Call node send_push.js with subscriptions on stdin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue