Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@ariya/penjabarberita
Advanced tools
Readme
Penjabar Berita: Pustaka JavaScript untuk Node.js (@ariya/penjabarberita) guna mendapatkan daftar artikel (judul, tautan, waktu) dari berkas HTML yang mewakili indeks berita tersebut.
Penjabar Berita dikhususkan untuk mengolah surat kabar daring Indonesia. Saat ini, yang bisa diproses adalah indeks berita dari Antara, BBC Indonesia, CNBC Indonesia, CNN Indonesia, Intisari, Jawa Pos, Kompas, Kontan, Liputan 6, Pikiran Rakyat, Republika, Suara, Tempo, The Conversations, TurnBackHoax, Viva News.
Instalasi: npm install @ariya/penjabarberita
.
Misalkan berkas data.html
didapatkan dengan mengambil indeks berita dari laman surat kabar Kompas, katakanlah menggunakan cURL dengan langkah curl -o data.html https://www.kompas.com/tag/virus-corona
, maka berkas tersebut bisa diproses seperti di bawah ini:
const fs = require('fs');
const penjabarberita = require('@ariya/penjabarberita');
const buffer = fs.readFileSync('data.html', 'utf-8');
const list = penjabarberita(buffer.toString());
console.log(list.map(n => n.title));
yang akan menghasilkan keluaran seperti:
[
'Pentingnya Meningkatkan Sistem Kekebalan Tubuh dengan Vitamin',
'Bisakah Virus Corona Bertahan di Rambut Manusia?',
// dst...
]
Di samping judul artikel (title
), bisa juga didapatkan tautan (url
) dan tanggal/waktu (timestamp
, sebagai Unix epoch).
Penjabar Berita: A JavaScript library for Node.js (@ariya/penjabarberita) to extract the article list (title, link, timestamp) from its HTML representation.
Penjabar Berita is geared towards processing the article index of online news sites in Indonesia, currently supporting Antara, BBC Indonesia, CNBC Indonesia, CNN Indonesia, Intisari, Jawa Pos, Kompas, Kontan, Liputan 6, Pikiran Rakyat, Republika, Suara, Tempo, The Conversations, TurnBackHoax, Viva News.
Installation: npm install @ariya/penjabarberita
.
Assuming data.html
is obtained by retrieving the news index from Kompas, for instance (by using cURL) curl -o data.html https://www.kompas.com/tag/virus-corona
, then the file can be processed as follows:
const fs = require('fs');
const penjabarberita = require('@ariya/penjabarberita');
const buffer = fs.readFileSync('data.html', 'utf-8');
const list = penjabarberita(buffer.toString());
console.log(list.map(n => n.title));
which will result in:
[
'Pentingnya Meningkatkan Sistem Kekebalan Tubuh dengan Vitamin',
'Bisakah Virus Corona Bertahan di Rambut Manusia?',
// and so on...
]
In addition to the article title (title
), the article link (url
) and published date/time (timestamp
, as Unix epoch) are available as well.
FAQs
Extract the article list from its raw news HTML
The npm package @ariya/penjabarberita receives a total of 2 weekly downloads. As such, @ariya/penjabarberita popularity was classified as not popular.
We found that @ariya/penjabarberita demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.