Splyth / slack_bot

Slack Bot Created for the Animutiny Slack Group (Name is Lisa)
MIT License
9 stars 5 forks source link

Fix Image picking #40

Closed Mill1893 closed 4 years ago

Mill1893 commented 4 years ago

Image picking is done at random, should pick the first result for better accuracy.

Splyth commented 4 years ago

The thought process was if people asked for the same image multiple times they'd get different results.

Making them have a little more variety.

Mill1893 commented 4 years ago

I'll have to look into how many requests we're getting back with each request. If we're getting hundreds of potential images, we could probably narrow it down to the top 10 and still be able to get some variety.

Splyth commented 4 years ago

We can specify the count. Both bing and google are hard coded to 10 at the moment: https://github.com/Splyth/slack_bot/blob/master/lisa_commands/request_helper.py#L123 https://github.com/Splyth/slack_bot/blob/master/lisa_commands/request_helper.py#L106

Mill1893 commented 4 years ago

Yeah I just saw that, I'm looking at a way to maybe narrow down results for a more specific query (removing duplicates, specifying specific image types, etc.)

jedibob5 commented 4 years ago

I think picking from the top 3 might work (maybe top 5 at most?). Should cut down on the nonsense results while still giving a bit of variety. call the cops should probably pick from the top 10 at least, and youtube me should probably only pick the top result, since I think most queries to it are looking for a specific video.

Splyth commented 4 years ago

I'm going to lower the limits for now and see if that helps. https://github.com/Splyth/slack_bot/pull/44

Splyth commented 4 years ago

I've done the following: weighted google searches in favor of videogames, anime, and memes added various meme sites to bing searches.

Lisa appears to be giving more correct results.

Can reopen if people believe this is still an issue