@ששא @צדיק-תמים כתב בהתראה על יציאה ממ"ד & שיפור אתר פיקוד העורף:
אפשר גם לעשות scraping על הטלגרם שלהם, https://t.me/s/PikudHaOref_all?embed=1
מבחינתך זה סתם אתר אינטרנט
דוגמת קוד שכתבתי פעם ורצה עד היום:
const $ = cheerio.load(html);
return $('div.tgme_widget_message[data-post]').map((i, messageElem) => {
const postId = $(messageElem).attr('data-post');
const textContainer = $(messageElem).find('.tgme_widget_message_text.js-message_text');
textContainer.find('br').replaceWith('\n');
const messageText = textContainer.text().trim();
const datetimeAttr = $(messageElem).find('.tgme_widget_message_date time').attr('datetime') || '';
const formattedDate = datetimeAttr
? new Date(datetimeAttr).toLocaleString('he-IL', {
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
})
: '';
});