Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1.41 KB

random.md

File metadata and controls

71 lines (50 loc) · 1.41 KB

Random

The 'Random' object helps you generate random articles from specific wikipedia. You can also generate random language/wikipedia with this object. This has two methods namely Article and Language

📃 TABLE OF CONTENT

🪣 Importing module

To set up this module to work , you have to import the module first.

import { Random } from "wikifox";

Methods

Article

This method wil give you random article from specified wikipedia.Example from "en" which is "English Wikipedia" or "fr" which is "French Wikipedia" (Refer Wikipedia Editions for more). You can pass language code as second parameter

Exmaple
import { Random } from "wikifox";

Random.Article((data) => {
	console.log(data);
}, "en");

/* OUTPUT */

{
    success: true,
    data: {
       title: 'The_Old_Guard_(2020_film)',
       id: 60599040,
       language: 'en'
    }
}

Language

This method wil give you random language/wikipedia. Actually it is choosing randomly form this list!

Exmaple
import { Random } from "wikifox";

Random.Language((data) => {
	console.log(data);
});

/* OUTPUT */
{
  success: true,
  data: {
    name: 'Moldovan Wikipedia (deleted)',
    language: 'Moldovan',
    code: 'mg'
  }
}