Coder Social home page Coder Social logo

peterwzhang / tiktok-trivia-helper Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 1.0 24 KB

This is a program that attempts to find the answers for TikTok Trivia questions using Google and OpenAI's ChatGPT API.

License: MIT License

Python 100.00%
tiktok trivia automation google gpt3 bs4 pyautogui python ocr-text-reader tiktok-trivia

tiktok-trivia-helper's Introduction

TikTok Trivia Helper

This is a program that attempts to find the answers for TikTok Trivia questions using Google and OpenAI's ChatGPT. It also supports sending results to a Discord webhook.

As of 02/24/23 it has answered all non-video questions correctly (6/6 games).

Setup

In order to setup TikTok Trivia Helper you need the following:

Note: if you do not have an OpenAPI Token the helper will still work with Google without any changes.

Once you have the items listed above, follow these instructions below.

macOS Instructions

  1. Clone the repo: $ git clone https://github.com/peterwzhang/TikTok-Trivia-Helper.git
  2. Enter the newly created directory $ cd TikTok-Trivia-Helper
  3. Create a venv: $ python -m venv ./venv
  4. (Optional) Open ./venv/bin/activate and add export OPENAI_API_KEY=PASTE YOUR API KEY HERE to the end of the file
  5. (Optional) in the same file as step 4 add export DISC_WEBHK_URL=PASTE YOUR DISCORD WEBHOOK URL HERE
  6. Activate venv: $ source ./venv/bin/activate
  7. Install requirements: $ pip install -r requirements.txt
  8. Take a screenshot of your entire primary screen while a trivia question is being shown with the green timer progress bar. You will need this to change some values in ttthelper.py.
    • For TIMER_POSITION pick any coordinate (x, y) near the center of the timer.
    • For TIMER_COLOR get the (R, G, B, 255) values at the point for TIMER_POSITION
    • For QUESTION_REGION get the coordinate (x,y) of the top-left, width, height of the question and answer box. Then use this format (x, y, width, height)
  9. Run TikTok Trivia Helper: $ python -m src.ttthelper
    • To stop the program, press Ctrl + C in the terminal

Windows Instructions

  1. Clone the repo: $ git clone https://github.com/peterwzhang/TikTok-Trivia-Helper.git
  2. Enter the newly created directory $ cd TikTok-Trivia-Helper
  3. Create a venv: $ python -m venv ./venv
  4. (Optional) Open ./venv/Scripts/Activate.ps1 and add $env:OPENAI_API_KEY = 'PASTE YOUR API KEY HERE' to the end of the file
  5. (Optional) in the same file as step 4 add $env:DISC_WEBHK_URL='PASTE YOUR DISCORD WEBHOOK URL HERE'
  6. Activate venv: $ ./venv/Scripts/Activate.ps1
  7. Install requirements: $ pip install -r requirements.txt
  8. Take a screenshot of your entire primary screen while a trivia question is being shown with the green timer progress bar. You will need this to change some values in ttthelper.py.
    • For TIMER_POSITION pick any coordinate (x, y) near the center of the timer.
    • For TIMER_COLOR get the (R, G, B, 255) values at the point for TIMER_POSITION
    • For QUESTION_REGION get the coordinate (x,y) of the top-left, width, height of the question and answer box. Then use this format (x, y, width, height)
  9. Run TikTok Trivia Helper: $ python -m src.ttthelper
    • To stop the program, press Ctrl + C in the terminal

Preview

embed picture

terminal display

Contributing

If you would like to contribute, please create/find an issue then assign yourself and link a pull request to the issue.

If you have any suggestions you can create an issue also.

License

MIT license

tiktok-trivia-helper's People

Contributors

peterwzhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

khanher0

tiktok-trivia-helper's Issues

Log questions as JSON

Questions and answers should logged to a file in a JSON format as the game goes on or after the game ends.

Will probably need to add a way to exit the program gracefully rather than using CTRL + C

Improve Setup in README.md

README Improvements

  • Add setup for other operating systems
  • Add pictures to help with setup (ex. picture of where to get positions/regions for code changes)
  • Improve instructions that are unclear

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.