Ayogiakbar

INFO LOKER

Oct 2nd, 2025 (edited)
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * INFO LOKER - Jobstreet
  3.  * Author : gienetic
  4.  * Base   : https://play.google.com/store/apps/details?id=com.jobstreet.jobstreet
  5.  */
  6.  
  7. const axios = require("axios");
  8. const dayjs = require("dayjs");
  9.  
  10. async function cariLoker(pekerjaan, kota, jumlah = 10) {
  11.   const url = "https://jobsearch-api.cloud.seek.com.au/v5/search";
  12.   const params = {
  13.     keywords: pekerjaan,
  14.     where: kota,
  15.     sitekey: "ID",
  16.     sourcesystem: "houston",
  17.     pageSize: jumlah,
  18.     page: 1,
  19.     locale: "id-ID",
  20.   };
  21.  
  22.   try {
  23.     const res = await axios.get(url, { params });
  24.     const jobs = res.data.data || [];
  25.  
  26.     if (jobs.length === 0) {
  27.       return "āŒ Tidak ada lowongan ditemukan.";
  28.     }
  29.  
  30.     let hasil = `šŸ“Œ *Hasil Pencarian Lowongan*\nšŸ” ${pekerjaan} di ${kota}\n\n`;
  31.     jobs.forEach((job, i) => {
  32.       const judul = job.title || "-";
  33.       const perusahaan = job.companyName || "-";
  34.       const lokasi = job.locations?.[0]?.label || "-";
  35.       const tanggal = job.listingDate ? dayjs(job.listingDate).format("DD MMM YYYY") : "-";
  36.       const gaji = job.salaryLabel || "āŒ Tidak dicantumkan";
  37.       const deskripsi = job.teaser || "-";
  38.       const logo = job.branding?.serpLogoUrl || "-";
  39.       const tautan = `https://id.jobstreet.com/job/${job.id}`;
  40.  
  41.       hasil += `*${i + 1}. ${judul}*\n`;
  42.       hasil += `šŸ¢ Perusahaan : ${perusahaan}\n`;
  43.       hasil += `šŸ“ Lokasi     : ${lokasi}\n`;
  44.       hasil += `šŸ—“ļø Tanggal   : ${tanggal}\n`;
  45.       hasil += `šŸ’° Gaji      : ${gaji}\n`;
  46.       hasil += `šŸ“„ Deskripsi : ${deskripsi}\n`;
  47.       hasil += `šŸ–¼ Logo      : ${logo}\n`;
  48.       hasil += `šŸ”— Link      : ${tautan}\n`;
  49.       hasil += `───────────────────────────────\n`;
  50.     });
  51.  
  52.     return hasil;
  53.   } catch (err) {
  54.     return `āŒ Terjadi kesalahan: ${err.response?.status} - ${err.response?.statusText}`;
  55.   }
  56. }
  57.  
  58. module.exports = { cariLoker };
  59.  
  60. /*
  61. Contoh penggunaan:
  62.  
  63. const { cariLoker } = require("./lib/infoloker");
  64.  
  65. (async () => {
  66.   const hasil = await cariLoker("welder", "Sukabumi", 5);
  67.   console.log(hasil);
  68. })();
  69. */
  70.  
Advertisement
Add Comment
Please, Sign In to add comment