Files
RSSHub/lib/v2/dol/radar.js
T
Rachasak Ragkamnerdandrrachasak ba3c2925f8 feat: Add Thai Department Of Lands e-LandsAnnouncement website (#14245)
* feat: Add Thai DOL website

* feat: Add timezone, Radar for Thai DOL e-LandsAnnoucements

* Update lib/v2/dol/maintainer.js

* Update website/docs/routes/government.mdx

* Update lib/v2/dol/radar.js

---------

Co-authored-by: rrachasak <dev@rachasak.org>
2024-01-18 21:06:39 +08:00

34 lines
1.5 KiB
JavaScript

module.exports = {
'dol.go.th': {
_name: 'กรมที่ดิน (Thaland Department of Lands)',
announce: [
{
title: 'ประกาศกรมที่ดิน',
docs: 'https://docs.rsshub.app/routes/government#thailand-department-of-lands-e-landsannouncement',
source: '/index.php',
target: (params, url, document) => {
const queryParams = new URL(url).searchParams;
let rssPath = '/dol/announce';
if (!queryParams.has('searchconcerned')) {
return rssPath;
}
rssPath += `/${encodeURIComponent(queryParams.get('searchconcerned'))}`;
const province = document && document.querySelector('#searchprovince').value !== '' ? document.querySelector(`#searchprovince option[value="${document.querySelector('#searchprovince').value}"]`).text() : '';
const office = document && document.querySelector('#searchoffice').value !== '' ? document.querySelector(`#searchoffice option[value="${document.querySelector('#searchoffice').value}"]`).text() : '';
if (!province || !office) {
return rssPath;
}
rssPath += `/${encodeURIComponent(province)}/${encodeURIComponent(office)}`;
return rssPath;
},
},
],
},
};