HackQ-Trivia is a Python HQ Trivia bot. It receives HQ Trivia questions through their WebSocket connection and answers the questions automatically.
Requires Python 3.7 or above.
$ git clone https://github.com/Exaphis/HackQ-Trivia.git
$ cd HackQ-Trivia
$ pip install -r requirements.txt
The easiest way to find your bearer token is to run bearer_finder.py
.
Make sure you are in the HackQ-Trivia
folder, not hackq_trivia
.
$ python3 -m hackq_trivia.bearer_finder
Alternatively, it can be found by sniffing the traffic on your phone. The bearer token is easily found on an emulator, since they are easy to root and most use Android versions without certificate pinning. Popular tools used to obtain bearer tokens are Charles, Fiddler, and Burp Suite.
Paste your bearer token after Bearer
in hq_config.conf
,
all within one line.
HackQ-Trivia can utilize either Google or Bing search APIs.
The search settings are under the [SEARCH]
section in hq_config.conf
.
- To use the Google Custom Search Engine API, set
Service = Google
. - To use the Bing Web Search API, set
Service = Bing
.
CAUTION — First 100 queries per day are free, additional requests cost $5 per 1000 queries.
- Obtain an API key from https://developers.google.com/custom-search/v1/overview
- Paste it after
GoogleApiKey
inhq_config.conf
- Create a new custom search engine at https://cse.google.com/cse/
- Name your custom search engine and type in any valid URL in
Sites to search
- Click
Control Panel
- Enable
Search the entire web
- Delete the site you added initially in
Sites to search
- Copy the
Search engine ID
to clipboard - Paste it after
GoogleCseId
inhq_config.conf
- Create a free account at https://azure.microsoft.com/
- Enter the Azure portal
- Create a
Bing Search
resource from the Marketplace - Wait for setup...
- Open the service from your dashboard
- Open
Keys and Endpoint
- Copy
Key 1
orKey 2
to clipboard - Paste it after
BingApiKey
inhq_config.conf
Make sure you are in the HackQ-Trivia
folder, not hackq_trivia
.
$ python3 -m hackq_trivia.hq_main