Unable to fetch jokes
Abhisin90 opened this issue · comments
Inside index.js i have written this code
const jokes = require('give-me-a-joke')
console.dir(jokes)
jokes.getRandomDadJoke((joke) => {
console.log(joke)
})
On running it
I am getting this output
Similarly on running
const jokes = require('give-me-a-joke')
console.dir(jokes)
jokes.getRandomCNJoke((joke) => {
console.log(joke)
})
my output comes this
Is there any problem from my end or yours.
Kindly help.
Thanks for the help in advance
Hello @Abhisin90
The issue is not with the npm package but with the site it gets jokes from. You can verify it by having a look at the source code. As of Nov 4 2022, the site is down.
var giveMeAJoke = require("give-me-a-joke");
giveMeAJoke.getRandomDadJoke(function (joke) {
console.log(joke);
});
The above code will work fine because it gets jokes from some other site
it's just of the website is down not because of the pckage, if you try with Dadjokes it works fine, but with CNjokes it doesn't work
Do you guys want to contribute to make this package better? :-)
Hello @Saurabh3333.
To fix getRandomCNJoke
may I suggest using this API ?
The old API resource is not available anymore. If it's ok, I will submit a pull request