Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to fetch jokes #20

Closed
Abhisin90 opened this issue Oct 30, 2022 · 5 comments
Closed

Unable to fetch jokes #20

Abhisin90 opened this issue Oct 30, 2022 · 5 comments

Comments

@Abhisin90
Copy link

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

index js - node - Visual Studio Code 30-10-2022 13_15_01 (3)

Similarly on running

const jokes = require('give-me-a-joke')
console.dir(jokes)
jokes.getRandomCNJoke((joke) => {
console.log(joke)
})

my output comes this

index js - node - Visual Studio Code 30-10-2022 13_18_30

Is there any problem from my end or yours.
Kindly help.
Thanks for the help in advance

@user2695
Copy link

user2695 commented Nov 4, 2022

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

@walidChaybi
Copy link

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

@Saurabh3333
Copy link
Owner

Do you guys want to contribute to make this package better? :-)

@Villian79
Copy link

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

@Saurabh3333
Copy link
Owner

Saurabh3333 commented Mar 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants