wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Include article url in most viewed list

Open dlinx opened this issue 3 years ago • 2 comments

I tried most viewed function, it returned an Array of title and viewCount. I sent the title of returned value, and got the error No article found. I think it is better to send the wiki link along with title and viewCount

dlinx avatar Jan 14 '22 10:01 dlinx

Could you please provide an example with code and expected/actual results?

dijs avatar Jan 14 '22 12:01 dijs

I think you are running into the issue of looking up Special pages in Wikipedia.

I tried the same thing and it works just fine.

wiki()
			.mostViewed()
			.then(data => {
				const title = data[2].title;

				return wiki()
					.page(title)
					.then(pg =>
						pg.info().then(info => {
							info.birthPlace.should.equal('Manhattan');
							info.name.should.equal('Ronnie Spector');
						})
					);
			});

dijs avatar Jan 14 '22 13:01 dijs