Review my wikipedia viewer project and help me

Hi there,

Review for the wikipedia viewer project.

Every critiques are wellcome.

I didn’t find how to get a number limit (from the api) - gaplimit: 2 in the API doesn’t work

I would like to count the total article?

Thanks
wiki viewer

You’re a bit more advanced than me, so I can’t give a complete review of your code or anything.

But I will say…the way I usually test out other people’s Wikipedia viewers is by typing in ‘apple’ for my search term. Usually, this turns up a wiki article on the fruit, with maybe Apple (the company) being mentioned or a secondary result. When I entered this into your app, it came up as it should, but the top result brought me to a page listing the top songs of Fiona Apple. Thought it was worth mentioning. It didn’t seem right to me.

Food for thought, anyway.

1 Like

Thanks for your feedback, I typed apple and my first result was Inc Apple.
I was prefered to have an apple,

I just tried it again, and now every result brings me to an ‘Apple Inc. litigation’ article. The first 5 or 6 results all brought me to that page, anyway.

I fixed the issue, it was an mistake, I forgot to take off some test I did.
Thanks a lot

Great! Being an ultra-newbie, I’m glad my input could help.
Everything is working great on my end now. :slight_smile:

1 Like

I still stuck to count an object in a request asynchrones

Don’t quite understand what you want to count, but you can set limit of results (for example to 5) by adding srlimit: 5 in your ajax data (default is 10):

data: { action: 'query', list: 'search', srsearch: textSearch, format: 'json', srlimit: 5 },

If you just want to count returned results you can use a counter in your $.each() loop:

  let count = 0;
  $.each(x.query.search, function (index) {
    url = x.query.search[index].title;
    count++
  ...
  ...

Btw, your layout on wide screens is not very good :unamused:

1 Like

I tried to count with var and not let, I did exactly the same thing,
But I do again and it works.

I’m working on a laptop, I can’t see that, but I will.

EDIT:
How do you know for this parameter srlimit: 5
I looked in the API doc and I didn’t find…:frowning:

Thank you

@xavierartot I can’t really comment on the the functionality of it but it seems to work great good work.

The comment I would add is that when the link has been visited you can’t see the text. Other than that though it’s great.

Good point, I have to test if the html is empty then add a text ‘last result’ and inject the last value in the imput.
I don’t why I don’t keep the last result?

I just keep the last search in the input, thanks, I didn’t see that.

Looks cool! I think your UI UX a bit confusing but in general very good work!

1 Like

Great job! I find it great and a bit strange :slight_smile: But your font seems to be too thin.

1 Like