dijs / wiki

Wikipedia Interface for Node.js
MIT License
313 stars 62 forks source link

page.fullInfo() Maybe broken #100

Closed divanvb closed 5 years ago

divanvb commented 5 years ago

Hi

Can you check and see if page.fullInfo() works? Trying to access the article now but it keeps returning

Article not found

wikijs().page('https://cod-esports.gamepedia.com/Mindfreak').then(page => page.fullInfo()).then(console.log);

EDIT: It breaks on page I believe because it can't find an article.

EDIT: The typings(index.d.ts) file needs to be updated as well to include functions such as tables & fullInfo etc.

dijs commented 5 years ago

You don't pass the URL to page, only the name of the article.

You set the API url in the default import of wikijs

Like I have in my tests:

import wiki from `wikijs`
wiki({
      apiUrl: 'https://cod-esports.gamepedia.com/api.php'
    })
      .page('Mindfreak')
      .then(page => page.fullInfo())
divanvb commented 5 years ago

Oh my bad. Been using it for the last few days correctly, don't know why I suddenly did it the wrong way.

divanvb commented 5 years ago

EDIT: Sorry just to iterate again, the typings file has the fullInfo() function missing along with a few others. Can you just clarify for me that this is the case please?

dijs commented 5 years ago

That makes sense, since I never update that file. Is there a generator that you know of?