Last active
August 5, 2021 11:27
-
-
Save reacto11mecha/17cf0f388f56be7557f6585c8b388b87 to your computer and use it in GitHub Desktop.
Otomasi tugas biologi ibu aat kelas 10 cabang biologi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| const wiki = require("wikijs").default; | |
| const cabang = fs | |
| .readFileSync("./text_from_image.txt", "utf8") | |
| .split("\n") | |
| .filter((txt) => txt !== ""); | |
| const getPage = (page) => | |
| wiki({ apiUrl: "https://id.wikipedia.org/w/api.php" }).page(page); | |
| const sleep = () => new Promise((resolve) => setTimeout(resolve, 2000)); | |
| (async () => { | |
| let data = []; | |
| for (const cab of cabang) { | |
| await sleep(); | |
| const simpulan = await getPage(cab).then((p) => p.summary()); | |
| console.log(cab); | |
| data.push({ cab, simpulan }); | |
| } | |
| const conclution = data | |
| .map( | |
| (data) => | |
| `Cabang: ${data.cab} | |
| ${data.simpulan}` | |
| ) | |
| .join("\n\n\n") | |
| .replace(); | |
| fs.writeFileSync("./simpulan-akhir.txt", conclution); | |
| })(); | |
| // Dibuat Oleh: EZRA KHAIRAN PERMANA X BAHASA SMAN 12 BEKASI | |
| // 05/08/2021 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Anatomi | |
| Fisiologi | |
| Genetika | |
| Mikologi | |
| Mikrobiologi | |
| Anestesi | |
| Bakteriologi | |
| Bioteknologi | |
| Higiene | |
| Ekologi | |
| Embriologi | |
| Entomologi | |
| Etologi | |
| Evolusi | |
| Teratologi | |
| Botani | |
| Histologi | |
| Imunologi | |
| Zoologi | |
| Ornitologi | |
| Paleontologi | |
| Patologi | |
| Filogeni | |
| Ginekologi | |
| Filogeni | |
| Taksonomi | |
| Virologi | |
| Mikologi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install npm module yang bernama wikijs terlebih dahulu.