googlejobs: use clean udm=8 deep-link format for job URLs

Previous shareUrl-based URLs included session-tied tokens (shmd, shmds,
shem) that can expire over time, causing the job detail panel to not
open when the link is clicked later from Telegram.

Switch to a minimal Google Jobs URL using only the htidocid and the new
SPA fragment format:
  https://www.google.com/search?q=<q>&udm=8#vhid=vt%3D20/docid%3D<id>&vssid=jobs-detail-viewer

Verified via Playwright: this format reliably opens the specific job
detail panel without any session-tied parameters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
I Luk Kim 4 months ago
parent 0835522d06
commit a49a6539a1

@ -17,14 +17,20 @@ _EXTRACT_JS = """() => {
const shareEl = card.closest('[data-share-url]'); const shareEl = card.closest('[data-share-url]');
const shareUrl = shareEl ? shareEl.getAttribute('data-share-url') : ''; const shareUrl = shareEl ? shareEl.getAttribute('data-share-url') : '';
// Use shareUrl directly it contains the full fragment (#fpstate=tldetail&htidocid=...) // Build a clean udm=8 deep-link that opens the job detail panel.
// needed to open the job detail panel in Google Jobs. // The shareUrl has session-tied tokens (shmd, shmds, shem) that can expire;
let jobUrl = shareUrl; // we strip them and use only the htidocid + the new SPA fragment format.
let jobUrl = '';
let htidocid = ''; let htidocid = '';
if (shareUrl) { if (shareUrl) {
const docMatch = shareUrl.match(/htidocid=([^&]+)/); const docMatch = shareUrl.match(/htidocid=([^&]+)/);
const qMatch = shareUrl.match(/[?&]q=([^&#]+)/);
if (docMatch) { if (docMatch) {
htidocid = decodeURIComponent(docMatch[1]); htidocid = decodeURIComponent(docMatch[1]);
const q = qMatch ? qMatch[1] : 'orthodontist+job';
jobUrl = 'https://www.google.com/search?q=' + q + '&udm=8'
+ '#vhid=vt%3D20/docid%3D' + docMatch[1]
+ '&vssid=jobs-detail-viewer';
} }
} }

Loading…
Cancel
Save