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

Added POC for /google command #628

Merged
merged 11 commits into from
Oct 17, 2022
Merged

Added POC for /google command #628

merged 11 commits into from
Oct 17, 2022

Conversation

surajkumar
Copy link
Contributor

@surajkumar surajkumar commented Oct 14, 2022

This pull requests implements 2 new slash commands:

/google
This command searches Google for the input query and provides search results accordingly.

/googleit
This command takes the thread in #active_questions that the command was invoked from and Google's the title of the thread. The command only works in a thread within #active_questions.

In additon to the /googleit command, a message has been added to the bot that tells users that they can ask the bot to google their question.

Closes #627.

example of /google

example2 the modified bot message in #active_questions

example3 of /googleit

@surajkumar surajkumar requested review from a team as code owners October 14, 2022 13:22
@CLAassistant
Copy link

CLAassistant commented Oct 14, 2022

CLA assistant check
All committers have signed the CLA.

@marko-radosavljevic
Copy link
Contributor

Thanks for your contribution, and welcome to the project! ☺️ ❤️

Can you update your PR description and include some pictures of UI/UX in discord?

@surajkumar
Copy link
Contributor Author

This is for Zabu. I'll add all the relevant information once it's ready. This PR is to not be merged.

@marko-radosavljevic
Copy link
Contributor

Alright, will convert it to draft in that case. Thanks ^^

@marko-radosavljevic marko-radosavljevic marked this pull request as draft October 14, 2022 13:36
@Zabuzard
Copy link
Member

id suggest u make the PR a bit prettier. people will be happy to discuss the UX if u add a few pictures. not just me 👍

@Zabuzard Zabuzard added new command Add a new command or group of commands to the bot priority: normal labels Oct 14, 2022
@surajkumar
Copy link
Contributor Author

Updated the code and PR to be ready for prod. The API key should now be passed as an environment variable called "serpapi-api-key". Once Zabuzard creates the api keys file/store we can migrate to that.

@surajkumar surajkumar marked this pull request as ready for review October 14, 2022 17:59
@Tais993
Copy link
Member

Tais993 commented Oct 14, 2022

See the "config" class and config.json file

Exists already

@marko-radosavljevic
Copy link
Contributor

marko-radosavljevic commented Oct 14, 2022

UI/UX looks nice, I would just trim it down considerably. Just the first embed is enough, the other 5 embeds are not really useful, since they are small and don't provide a link.

If beginners knew how to google their answer, they wouldn't come to us for help and guidance, so it's important to not overwhelm them with 20 results. If the answer is not in the first 3 results, it's a badly asked question anyway, and other results won't help either. When was the last time you used 2nd page on google/searx? ^^

So yeah, I think it works better if it's short and sweet. Just top 3 results, what do you think? ^^

@surajkumar
Copy link
Contributor Author

surajkumar commented Oct 14, 2022

Changed the code to grab API key from the config.json.

UI/UX look nice, I would just trim it down considerably. Just the first embed is enough, the other 5 embeds are not really useful, since they are small and don't provide a link.

If beginners knew how to google their answer, they wouldn't come to us for help and guidance, so it's important to not overwhelm them with 20 results. If the answer is not in the first 3 results, it's a badly asked question anyway, and other results won't help either. When was the last time you used 2nd page on google/searx? ^^

The first embeds are the q&s from "People also ask" on the Google search page.
Example

The 5 embeds after it are clickable. Just click the titles.
As for your comments regarding the "2nd page". I use it all the time. Though in this case for the bot, it's the first 5 search results on the 1st page.

How would you like it formatted?

@surajkumar
Copy link
Contributor Author

Handing over. I won't have time to continue working on this as I was hoping it would only take a day to complete. All the changes are done. I suppose the only thing left would be the actual visual message. If it's sufficent, then this can be merged otherwise, whoever takes over can make the visual changes. Thanks

@marko-radosavljevic
Copy link
Contributor

The first embeds are the q&s from "People also ask" on the Google search page.

Ah, I see, now it's clear why there is a difference between first and other embeds, thanks.

Does anyone use 'people also ask'? I don't care what other people (also) ask, I care about the thing I asked.

Maybe it's useful for people that ask bad questions, so the engine helps them out with "hey, maybe this is what you are looking for". Or its quick answers to similar questions, that can easily fit in embed? Idea being that people don't have to open links and read long blog posts, answer is right there?

Genuinely curious, since I don't use that thing. But from the examples you posted, it looks useful. Maybe the normal search results would be more useful if they had the same amount of context as the first embed tho.

I would probably go with just 3 results, so it's not too overwhelming, but with enough context. Ideally, with the whole answer in the embed, so the user doesn't have to open links in their browser and read 30-minute guides. Maybe 'people also ask' is not a bad idea here, so 1 of that and 2 regular top results.

@surajkumar
Copy link
Contributor Author

The first embeds are the q&s from "People also ask" on the Google search page.

Ah, I see, now it's clear why there is a difference between first and other embeds, thanks.

Does anyone use 'people also ask'? I don't care what other people (also) ask, I care about the thing I asked.

Maybe it's useful for people that ask bad questions, so the engine helps them out with "hey, maybe this is what you are looking for". Or its quick answers to similar questions, that can easily fit in embed? Idea being that people don't have to open links and read long blog posts, answer is right there?

Genuinely curious, since I don't use that thing. But from the examples you posted, it looks useful. Maybe the normal search results would be more useful if they had the same amount of context as the first embed tho.

I would probably go with just 3 results, so it's not too overwhelming, but with enough context. Ideally, with the whole answer in the embed, so the user doesn't have to open links in their browser and read 30-minute guides. Maybe 'people also ask' is not a bad idea here, so 1 of that and 2 regular top results.

So the "people also ask" section is usually your same question but rephrased differently (often better). I would actually keep that there, it's very useful and I personally use it alot. Google by default limits this to 4. I reckon we should keep that and limit the organic results to maybe 2. So the bots message isn't too long and overwhelming.

To point out, the "people also ask" is not always visible due to the nature of some question (e.g. if the question is uncommon) in which case, maybe we can keep the top 4 results of the organic results.

So...

4 "people also ask"
2 organic search results

if no "people also ask" then 4 organic search results.

Opinion?

@Zabuzard
Copy link
Member

OP wants to transfer this to whoever else wants to work on it. I am going to move it from the fork to a branch.

@Zabuzard Zabuzard changed the base branch from develop to feature/google_command October 17, 2022 07:17
@Zabuzard Zabuzard merged commit bedfe22 into Together-Java:feature/google_command Oct 17, 2022
@Zabuzard
Copy link
Member

Transferred into #637 Thanks for the efforts @surajkumar 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new command Add a new command or group of commands to the bot priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google/Stackoverflow searching for #active-questions and or independent slash command
5 participants