This is a Node package that can be used to retrieve the list of celebrities borned on a particular date. With the help of search engines we can find it easily. But when it comes to program, we need to have some technique to get that list in our program, So that we can further perform the desired operations. To achieve this we have exploited that power of search engines to get the name of celebrities borned on the specified date from the internet without using any particular API, just web scrapping.
npm install born-on --save
After installing the package create a file with any name (say test.js) and write the folowing code-
var bornOn = require("born-on");
bornOn("02 october").then(info => {
if (Array.isArray(info)) {
for (let i = 0; i < info.length; i++) {
console.log(info[i]);
console.log(`\n`);
}
}
});
/* OUTPUT:
Mahatma Gandhi
Richard III of England
Roberto Firmino
Johnnie Cochran
Lal Bahadur Shastri
Lorraine Bracco
Huda Kattan
Groucho Marx
*/
If you want to retrieve the list of celebrities borned on a particular date and in a particular country you can do it as following-
var bornOn = require("born-on");
bornOn("02 october", "India").then(info => {
if (Array.isArray(info)) {
for (let i = 0; i < info.length; i++) {
console.log(info[i]);
console.log(`\n`);
}
}
});
/* OUTPUT:
Mahatma Gandhi
Lal Bahadur Shastri
Asha Parekh
Persis Khambatta
Rohit Roy
Ashutosh Kaushik
Rachana Banerjee
Praveen Kumar
*/
There can be a maximum of two inputs-
- Date of Birth in the following format
- Date followed by Name of Month ( 02 October ).
- Name of Country
The name of country can also be inserted at the run time by using any program or API that can provide the location using the IP address of the visitor.
The date in other formats may not be able to get the desired results as it is based on web scrapping.