Skip to content

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

Closed

Description

@surajkumar

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

Activity

  1. added
    enhancement
    on Oct 14, 2022
  2. Zabuzard commented on Oct 14, 2022

    @Zabuzard
    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

  3. Zabuzard commented on Oct 14, 2022

    @Zabuzard
    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).

  4. surajkumar commented on Oct 14, 2022

    @surajkumar
    ContributorAuthor

    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.

  5. Zabuzard commented on Oct 14, 2022

    @Zabuzard
    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.

  6. surajkumar commented on Oct 14, 2022

    @surajkumar
    ContributorAuthor

    Ignore that lib, we have to do it manually.

  7. Zabuzard commented on Oct 17, 2022

    @Zabuzard
    Member

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

  8. github-actions commented on Nov 17, 2022

    @github-actions

    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.

  9. added
    inactivity-closed
    on Nov 17, 2022
  10. added
    valid
    and removed
    inactivity-closed
    on Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority: normalstalevalid

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions