forked from izu/student-web-if-development-kit
Fix logic API
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
return s; // "Segera Dibuka" atau nilai lain: tampilkan apa adanya
|
||||
}
|
||||
|
||||
// Petakan satu item Directus ke skema yang diharapkan filter.js / popup.js
|
||||
// Petakan satu item (API remote maupun lokal) ke skema yang diharapkan filter.js / popup.js
|
||||
function normalizeItem(item) {
|
||||
const parts = [item.jenjang, item.negara, item.tipe_pendanaan].filter(Boolean);
|
||||
return {
|
||||
@@ -34,14 +34,16 @@
|
||||
nama: item.nama || '',
|
||||
status: normalizeStatus(item.status),
|
||||
kategori: item.tipe_pendanaan || '',
|
||||
thumbnail: '',
|
||||
deskripsi_singkat: parts.join(' · ') || 'Info beasiswa tersedia di sumber resmi.',
|
||||
thumbnail: item.thumbnail || '',
|
||||
deskripsi_singkat: item.deskripsi_singkat || parts.join(' · ') || 'Info beasiswa tersedia di sumber resmi.',
|
||||
deskripsi_singkat_en: item.deskripsi_singkat_en || '',
|
||||
tanggal_buka: item.tanggal_buka || '',
|
||||
tanggal_tutup: item.tenggat_waktu || '',
|
||||
url_sumber: item.url || '',
|
||||
syarat_umum: [],
|
||||
kontak: '',
|
||||
tags: parts,
|
||||
syarat_umum: item.syarat_umum || [],
|
||||
syarat_umum_en: item.syarat_umum_en || [],
|
||||
kontak: item.kontak || '',
|
||||
tags: item.tags || parts,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -56,23 +58,22 @@
|
||||
const res = await fetch(CONFIG.localSource);
|
||||
if (!res.ok) throw new Error(`Gagal memuat data lokal (HTTP ${res.status})`);
|
||||
const json = await res.json();
|
||||
return Array.isArray(json) ? json : json.data || [];
|
||||
const raw = Array.isArray(json) ? json : json.data || [];
|
||||
return raw.map(normalizeItem);
|
||||
}
|
||||
|
||||
async function getBeasiswa() {
|
||||
try {
|
||||
// Prioritas: data lokal (lengkap: url_sumber, syarat_umum, kontak tersedia)
|
||||
// Remote API digunakan hanya sebagai fallback jika data lokal tidak ditemukan.
|
||||
const data = await fetchLocal();
|
||||
return { data, source: 'local' };
|
||||
const data = await fetchRemote();
|
||||
return { data, source: 'remote' };
|
||||
} catch (err) {
|
||||
console.warn('[BeasiswaAPI] Data lokal gagal, fallback ke API remote:', err.message);
|
||||
console.warn('[BeasiswaAPI] API remote gagal, fallback ke data lokal:', err.message);
|
||||
try {
|
||||
const data = await fetchRemote();
|
||||
return { data, source: 'remote' };
|
||||
} catch (remoteErr) {
|
||||
console.error('[BeasiswaAPI] Semua sumber gagal:', remoteErr.message);
|
||||
throw remoteErr;
|
||||
const data = await fetchLocal();
|
||||
return { data, source: 'local' };
|
||||
} catch (localErr) {
|
||||
console.error('[BeasiswaAPI] Semua sumber gagal:', localErr.message);
|
||||
throw localErr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
[
|
||||
{
|
||||
"id": "bsw-001",
|
||||
"id": 101,
|
||||
"nama": "Boustany Foundation Scholarship, MBA - Harvard University",
|
||||
"nama_en": "Boustany Foundation Scholarship, MBA - Harvard University",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S2",
|
||||
"negara": "Amerika Serikat",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tenggat_waktu": "2027-05-31",
|
||||
"url": "https://www.schoters.com/id/beasiswa/boustany-foundation-scholarship-mba-harvard-university-1",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1541339907198-e08756dedf3f?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa bergengsi dari Boustany Foundation untuk program MBA di Harvard University, Amerika Serikat, bagi calon pemimpin bisnis dunia.",
|
||||
"deskripsi_singkat_en": "A prestigious scholarship from the Boustany Foundation for the MBA program at Harvard University, United States, for future global business leaders.",
|
||||
@@ -22,17 +26,19 @@
|
||||
"Complete the scholarship application online through the official Boustany Foundation website"
|
||||
],
|
||||
"kontak": "Boustany Foundation — boustany-foundation.com",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tanggal_tutup": "2027-05-31",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/boustany-foundation-scholarship-mba-harvard-university-1",
|
||||
"tags": ["S2", "Swasta", "Amerika Serikat", "Partially Funded", "MBA"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-002",
|
||||
"id": 102,
|
||||
"nama": "La Trobe University - La Trobe High Achiever Scholarship (S1)",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "La Trobe University - La Trobe High Achiever Scholarship (S1)",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S1",
|
||||
"negara": "Australia",
|
||||
"tanggal_buka": "2023-09-29",
|
||||
"tenggat_waktu": "2026-12-31",
|
||||
"url": "https://www.schoters.com/id/beasiswa/la-trobe-university-la-trobe-high-achiever-scholarship-2",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1523240795612-9a054b0db644?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa dari La Trobe University Australia untuk mahasiswa internasional jenjang S1 berprestasi tinggi yang ingin melanjutkan studi di Melbourne.",
|
||||
"deskripsi_singkat_en": "Scholarship from La Trobe University Australia for high-achieving international undergraduate students who wish to pursue their studies in Melbourne.",
|
||||
@@ -49,17 +55,19 @@
|
||||
"Meet La Trobe University's entry and English language requirements"
|
||||
],
|
||||
"kontak": "La Trobe University Admissions — latrobe.edu.au",
|
||||
"tanggal_buka": "2023-09-29",
|
||||
"tanggal_tutup": "2026-12-31",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/la-trobe-university-la-trobe-high-achiever-scholarship-2",
|
||||
"tags": ["S1", "Swasta", "Australia", "Partially Funded"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-003",
|
||||
"id": 103,
|
||||
"nama": "Charles Sturt University - International Student Support Scholarship",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "Charles Sturt University - International Student Support Scholarship",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S1",
|
||||
"negara": "Australia",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tenggat_waktu": "2026-12-31",
|
||||
"url": "https://www.schoters.com/id/beasiswa/charles-sturt-university-international-student-support-scholarship-3",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1560472354-b33ff0c44a43?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa dukungan dari Charles Sturt University bagi mahasiswa internasional jenjang S1 yang mendaftar di kampus yang berlokasi di New South Wales, Australia.",
|
||||
"deskripsi_singkat_en": "Support scholarship from Charles Sturt University for international undergraduate students enrolling at a campus located in New South Wales, Australia.",
|
||||
@@ -76,17 +84,19 @@
|
||||
"Apply through the official international admission pathway"
|
||||
],
|
||||
"kontak": "Charles Sturt University International — csu.edu.au",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tanggal_tutup": "2026-12-31",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/charles-sturt-university-international-student-support-scholarship-3",
|
||||
"tags": ["S1", "Swasta", "Australia", "Partially Funded"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-004",
|
||||
"id": 104,
|
||||
"nama": "La Trobe University - La Trobe High Achiever Scholarship (S2)",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "La Trobe University - La Trobe High Achiever Scholarship (S2)",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S2",
|
||||
"negara": "Australia",
|
||||
"tanggal_buka": "2023-09-29",
|
||||
"tenggat_waktu": "2026-12-31",
|
||||
"url": "https://www.schoters.com/id/beasiswa/la-trobe-university-la-trobe-high-achiever-scholarship-4",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa dari La Trobe University Australia untuk mahasiswa internasional jenjang S2 (Postgraduate) dengan pencapaian akademik tinggi.",
|
||||
"deskripsi_singkat_en": "Scholarship from La Trobe University Australia for international postgraduate students with high academic achievements.",
|
||||
@@ -103,17 +113,19 @@
|
||||
"Not currently receiving another scholarship from the same university"
|
||||
],
|
||||
"kontak": "La Trobe University Admissions — latrobe.edu.au",
|
||||
"tanggal_buka": "2023-09-29",
|
||||
"tanggal_tutup": "2026-12-31",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/la-trobe-university-la-trobe-high-achiever-scholarship-4",
|
||||
"tags": ["S2", "Swasta", "Australia", "Partially Funded"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-005",
|
||||
"id": 105,
|
||||
"nama": "ETH Zurich - Excellence Scholarship & Opportunity Programme (ESOP)",
|
||||
"kategori": "Pemerintah",
|
||||
"kategori_en": "Government",
|
||||
"nama_en": "ETH Zurich - Excellence Scholarship & Opportunity Programme (ESOP)",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Pemerintah",
|
||||
"jenjang": "S2",
|
||||
"negara": "Swiss",
|
||||
"tanggal_buka": "2026-11-01",
|
||||
"tenggat_waktu": "2026-11-30",
|
||||
"url": "https://www.schoters.com/id/beasiswa/eth-zurich-excellence-scholarship-opportunity-programme-esop-5",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa bergengsi dari ETH Zurich (salah satu universitas teknik terbaik dunia) untuk mahasiswa S2 internasional yang unggul secara akademik.",
|
||||
"deskripsi_singkat_en": "Prestigious scholarship from ETH Zurich (one of the world's best engineering universities) for academically outstanding international master's students.",
|
||||
@@ -132,17 +144,19 @@
|
||||
"Obtain a recommendation letter from authorized academics"
|
||||
],
|
||||
"kontak": "ETH Zurich Scholarship Office — ethz.ch",
|
||||
"tanggal_buka": "2026-11-01",
|
||||
"tanggal_tutup": "2026-11-30",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/eth-zurich-excellence-scholarship-opportunity-programme-esop-5",
|
||||
"tags": ["S2", "Pemerintah", "Swiss", "Fully Funded", "Prestasi"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-006",
|
||||
"id": 106,
|
||||
"nama": "STUST - Scholarship for International Students (S3, Fully Funded)",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "STUST - Scholarship for International Students (S3, Fully Funded)",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S3",
|
||||
"negara": "Taiwan",
|
||||
"tanggal_buka": "2026-09-15",
|
||||
"tenggat_waktu": "2026-11-30",
|
||||
"url": "https://www.schoters.com/id/beasiswa/southern-taiwan-university-of-science-and-technology-the-stust-scholarship-for-international-students-6",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1580582932707-520aed937b7b?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa penuh (fully funded) dari Southern Taiwan University of Science and Technology untuk mahasiswa internasional jenjang S3 (Doktoral).",
|
||||
"deskripsi_singkat_en": "Fully funded scholarship from Southern Taiwan University of Science and Technology for international doctoral students.",
|
||||
@@ -161,17 +175,19 @@
|
||||
"Obtain approval from a prospective supervisor at STUST"
|
||||
],
|
||||
"kontak": "STUST International Affairs Office — stust.edu.tw",
|
||||
"tanggal_buka": "2026-09-15",
|
||||
"tanggal_tutup": "2026-11-30",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/southern-taiwan-university-of-science-and-technology-the-stust-scholarship-for-international-students-6",
|
||||
"tags": ["S3", "Swasta", "Taiwan", "Fully Funded"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-007",
|
||||
"id": 107,
|
||||
"nama": "STUST - Scholarship for International Students (S2, Partially Funded)",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "STUST - Scholarship for International Students (S2, Partially Funded)",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S2",
|
||||
"negara": "Taiwan",
|
||||
"tanggal_buka": "2026-09-15",
|
||||
"tenggat_waktu": "2026-11-30",
|
||||
"url": "https://www.schoters.com/id/beasiswa/southern-taiwan-university-of-science-and-technology-the-stust-scholarship-for-international-students-7",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1606761568499-6d2451b23c66?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa parsial (partially funded) dari Southern Taiwan University of Science and Technology untuk mahasiswa internasional jenjang S2 (Magister).",
|
||||
"deskripsi_singkat_en": "Partially funded scholarship from Southern Taiwan University of Science and Technology for international master's students.",
|
||||
@@ -190,17 +206,19 @@
|
||||
"Include academic transcripts and a motivation letter"
|
||||
],
|
||||
"kontak": "STUST International Affairs Office — stust.edu.tw",
|
||||
"tanggal_buka": "2026-09-15",
|
||||
"tanggal_tutup": "2026-11-30",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/southern-taiwan-university-of-science-and-technology-the-stust-scholarship-for-international-students-7",
|
||||
"tags": ["S2", "Swasta", "Taiwan", "Partially Funded"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-008",
|
||||
"id": 108,
|
||||
"nama": "University of Melbourne - Melbourne International Undergraduate Scholarship",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "University of Melbourne - Melbourne International Undergraduate Scholarship",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S1",
|
||||
"negara": "Australia",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tenggat_waktu": "2026-10-31",
|
||||
"url": "https://www.schoters.com/id/beasiswa/university-of-melbourne-melbourne-international-undergraduate-scholarship-8",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1504711434969-e33886168f5c?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa untuk mahasiswa internasional berprestasi yang mendaftar program S1 di University of Melbourne, salah satu universitas terbaik di Australia.",
|
||||
"deskripsi_singkat_en": "Scholarship for outstanding international students applying for an undergraduate program at the University of Melbourne, one of Australia's best universities.",
|
||||
@@ -219,17 +237,19 @@
|
||||
"The scholarship is awarded automatically based on academic merit, no separate application required"
|
||||
],
|
||||
"kontak": "University of Melbourne Future Students — unimelb.edu.au",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tanggal_tutup": "2026-10-31",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/university-of-melbourne-melbourne-international-undergraduate-scholarship-8",
|
||||
"tags": ["S1", "Swasta", "Australia", "Partially Funded", "Prestasi"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-009",
|
||||
"id": 109,
|
||||
"nama": "Charles Darwin University - CDU Global Merit Scholarship",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "Charles Darwin University - CDU Global Merit Scholarship",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S1",
|
||||
"negara": "Australia",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tenggat_waktu": "2026-10-09",
|
||||
"url": "https://www.schoters.com/id/beasiswa/charles-darwin-university-cdu-global-merit-scholarship-9",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa merit global dari Charles Darwin University (CDU) di Darwin, Australia, untuk mahasiswa internasional S1 yang memiliki rekam jejak akademik yang kuat.",
|
||||
"deskripsi_singkat_en": "Global merit scholarship from Charles Darwin University (CDU) in Darwin, Australia, for international undergraduate students with a strong academic track record.",
|
||||
@@ -248,17 +268,19 @@
|
||||
"Not currently receiving any other tuition fee discount from CDU"
|
||||
],
|
||||
"kontak": "CDU International — cdu.edu.au",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tanggal_tutup": "2026-10-09",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/charles-darwin-university-cdu-global-merit-scholarship-9",
|
||||
"tags": ["S1", "Swasta", "Australia", "Partially Funded"]
|
||||
},
|
||||
{
|
||||
"id": "bsw-010",
|
||||
"id": 110,
|
||||
"nama": "Deakin University - Vice-Chancellor's International Scholarship",
|
||||
"kategori": "Swasta",
|
||||
"kategori_en": "Private",
|
||||
"nama_en": "Deakin University - Vice-Chancellor's International Scholarship",
|
||||
"status": "Buka",
|
||||
"tipe_pendanaan": "Swasta",
|
||||
"jenjang": "S1 & S2",
|
||||
"negara": "Australia",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tenggat_waktu": "2026-09-25",
|
||||
"url": "https://www.schoters.com/id/beasiswa/deakin-university-vice-chancellor-s-international-scholarship-10",
|
||||
"thumbnail": "https://images.unsplash.com/photo-1541339907198-e08756dedf3f?w=400&q=80&auto=format&fit=crop",
|
||||
"deskripsi_singkat": "Beasiswa bergengsi dari Wakil Rektor (Vice-Chancellor) Deakin University untuk mahasiswa internasional terbaik yang akan menempuh studi S1 atau S2 di Australia.",
|
||||
"deskripsi_singkat_en": "Prestigious Vice-Chancellor's scholarship from Deakin University for the best international students pursuing an undergraduate or postgraduate degree in Australia.",
|
||||
@@ -277,9 +299,6 @@
|
||||
"Submit the scholarship application before the specified closing date"
|
||||
],
|
||||
"kontak": "Deakin University International — deakin.edu.au",
|
||||
"tanggal_buka": "2026-05-21",
|
||||
"tanggal_tutup": "2026-09-25",
|
||||
"url_sumber": "https://www.schoters.com/id/beasiswa/deakin-university-vice-chancellor-s-international-scholarship-10",
|
||||
"tags": ["S1 & S2", "S2", "Swasta", "Australia", "Partially Funded", "Prestasi"]
|
||||
"tags": ["S1 & S2", "Swasta", "Australia", "Partially Funded", "Prestasi"]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user