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

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

Closed
surajkumar opened this issue Oct 14, 2022 · 8 comments · Fixed by #628
Closed
Labels
enhancement New feature or request priority: normal stale valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board.

Comments

@surajkumar
Copy link
Contributor

surajkumar commented Oct 14, 2022

There are often a questions that are asked in the #active-questions channel that could we resolved with a quick Google search. An example what I have seen recently was along the lines of "Why do we need a connection pool for JDBC?". The exact question in that exact format, searched on Google gave the questioner the exact answer they were looking for.

Introducing a feature within the bot that does a quick Google or Stackoverflow search would an excellent feature for such questions. The bot can query the thread title and post back the first x results to the user. In that scenario, if the searche results answer the users question, questions can be closed immediatly without the user having to wait for somebody to respond.

The following API's are available for the implementation:

https://api.stackexchange.com/docs/search
https://developers.google.com/custom-search/v1/overview

Google limits us to 100 searches per day. As discussed with Zabuzard, it should be fine as long as the user inititates the request and not the bot automatically. The end solution may be that the bot sends a message saying "Would you like me to search [title] on Google?". User can react to the message and see a bunch of results.

With the additional functionality, an introduction of two new slash commands.
/google
/stackoverflow

@surajkumar surajkumar added the enhancement New feature or request label Oct 14, 2022
@Zabuzard
Copy link
Member

its a pretty interesting idea that can definitely enhance the UX. we just have to be good on the UX for the entry point. some things to consider:

title

  • users are often bad with picking a decent thread title. we dont want to have a lot of useless searches like googling "please help me" or "error in my code"

so we have to make sure that we have a decent query before we actually send out something. some ideas:

  • give the user a button to trigger it manually when they feel ready
  • attempt to parse the thread title and figure out how good it is (probably very hard)
  • offer a slashcommand that can be used (primarily by helpers) instead

friendly

  • the UX has to be friendly. posting links like LMGTFY (let me google that for you) are received very badly and perceived as arrogant.

so something like "I found some really promising results on Google. Have a look at: " might work

@Zabuzard
Copy link
Member

my preference

personally, i am leaning towards a slashcommand (primarily for helpers), such as /search query: Java how to write hello world?, which has a friendly message and a shows maybe the first 8 hits as embeds.

google usually also shows the best stackoverflow results, so i dont think we have to add that extra.

use case

the question i ask myself is: for whom is this? i doubt that actual askers will trigger this command or click a button. cause they think they already exhausted all the search enginges themselves - otherwise they wouldnt ask in a discord in the first place.

i.e. they are bad at searching themselves. they are bad at creating a decent title. they dont know what to search for. otherwise they would have found it themselves already.

hence why i think the priority-audience for this feature should be the helpers. the helpers who know what to search and just want to tell OP that their question can be answered by searching with the following query (which they couldnt come up with themselves).

@surajkumar
Copy link
Contributor Author

Yes I agree a better usecase will be for helpers. It's low effort to implement Stackoverflow searching as an alternative to if we ever use our 100 Google searches per day. It would be the best fall-back option for a helper.

Slightly disagree with the comment of askers having already searched their questions. We both have seen how lazy some askers actually are like in the example I provided which was a real question asked in the server. At the minimum, at least the functionality can be there for them.

@Zabuzard
Copy link
Member

One thing for sure, you can already get started on:

  • integrating the google api (perhaps there is even a java wrapper already that we can just import as dependency? - otherwise look at WolframAlphaCommand which does rest-api stuff manually)
  • writing a nice response with embeds

the entry point can always still be adjusted easily.

the API key goes into the config, i can create one for our team later.

@surajkumar
Copy link
Contributor Author

surajkumar commented Oct 14, 2022

Ignore that lib, we have to do it manually.

@Zabuzard
Copy link
Member

#637 has a PoC for that, development should be continued there. its mostly just missing polishing. the groundwork has been done already.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

@github-actions github-actions bot added stale inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later labels Nov 17, 2022
@marko-radosavljevic marko-radosavljevic added valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. and removed inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later labels Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: normal stale valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants