Coder Social home page Coder Social logo

puneey / hackq-trivia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from exaphis/hackq-trivia

0.0 0.0 0.0 339 KB

Yet another HQ Trivia bot. Automatically scrapes HQ Trivia questions without OCR and answers them.

License: MIT License

Python 100.00%

hackq-trivia's Introduction

HackQ-Trivia is a Python HQ Trivia bot. It receives HQ Trivia questions through their WebSocket connection and answers the questions automatically.

Installation

Requires Python 3.7 or above.

Code and dependencies

$ git clone https://github.com/Exaphis/HackQ-Trivia.git
$ cd HackQ-Trivia
$ pip install -r requirements.txt

Bearer token

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.

Search APIs

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.

Google Search

Google Custom Search Engine API Key

CAUTION โ€” First 100 queries per day are free, additional requests cost $5 per 1000 queries.

Google Custom Search Engine ID

  • 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 in hq_config.conf

Bing Search

  • 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 or Key 2 to clipboard
  • Paste it after BingApiKey in hq_config.conf

Usage

Make sure you are in the HackQ-Trivia folder, not hackq_trivia.

$ python3 -m hackq_trivia.hq_main

Screenshots

Screenshot when HQ is not live

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.