Skip to content

Feat:add next year when scrapped on december#24

Open
azharazziz wants to merge 2 commits intogerinsp:masterfrom
azharazziz:master
Open

Feat:add next year when scrapped on december#24
azharazziz wants to merge 2 commits intogerinsp:masterfrom
azharazziz:master

Conversation

@azharazziz
Copy link

Deskripsi

Menambahkan fitur otomatis untuk scraping data libur nasional tahun depan ketika bulan Desember terdeteksi.

Detail Perubahan

✨ Fitur Baru

  • Mendeteksi apakah bulan saat ini adalah Desember (bulan ke-12)
  • Jika Desember, scraper akan secara otomatis melakukan scraping untuk 2 tahun:
    • Tahun saat ini
    • Tahun depan
  • Menggunakan Promise.all() untuk menjalankan kedua scraping secara paralel
  • Data untuk setiap tahun disimpan dalam file terpisah (contoh: 2025.json dan 2026.json)

🎯 Manfaat

  • Memastikan data libur nasional tahun depan tersedia lebih awal
  • Mengurangi kebutuhan untuk scraping manual di akhir tahun
  • Proses yang otomatis dan efisien menggunakan Promise paralel

📝 Contoh Perilaku

  • Jika bulan saat ini = Januari - November: Scraping hanya untuk tahun saat ini
  • Jika bulan saat ini = Desember: Scraping untuk tahun saat ini + tahun depan

🔧 Implementasi

Modifikasi dilakukan di fungsi scraper() dengan menambahkan kondisional:

if (monthNow === 12) {
  return Promise.all([scraperData(yearNow), scraperData(yearNow + 1)]);
}

@vercel
Copy link

vercel bot commented Dec 12, 2025

@azharazziz is attempting to deploy a commit to the gerinsp's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant