Skip to content

gaming-gaming/Word-of-the-Day

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word of the Day

Managed by Sesquipedalians Version Free API for Developers License

Integration for Discord Made With Python Made With HTML5 Made With CSS Made With JavaScript Powered by SQLite

Overview

Word of the Day (WOTD) is a service for providing a unique and interesting word every day via website and communication services. The code is completely free to use and open-source under the Apache License 2.0.

Key Features

  • A website for displaying the Word of the Day (default port: 443)
  • A free API for requesting Word of the Day data (default port: 8443)
  • A Discord bot that messages subscribing users and server channels daily

Warning

The words database in this repository that the script uses only comes with the first 16 words, from 1 January 2025, to 16 January 2025. You must provide your own words or download the public database at https://wotd.site/download/words_public.db.

Extensions

Word of the Day comes with extensions you may use in ./src/extensions. The extensions included by default are for providing channels to access Word of the Day. You may make your own extensions by creating a folder with a __init__.py file inside.

Website + API

The Site extension is in the folder ./src/extensions/site. This extension is for both the main website (wotd.site) and the API (api.wotd.site). Inside the extension's folder is a config.json file for configuring the site, and a .env file for setting the hashed admin password. There is also a messages/ folder for messages sent via the contact page, which contains json files of user mail.

The API has a variety of endpoints for developers to use:

  • /query?date={date}: Gets the WOTD for a specific date (format: DD-MM-YYYY). If no date is provided, it defaults to the current date.
  • /query_previous?date={date}&limit={limit}: Gets a list of previous WOTDs. The date parameter is optional and defaults to the current date. The limit parameter specifies how many previous WOTDs to return (default is 3, maximum is 8).
  • /find_wotd?word={word}: Searches for a specific word in the WOTD database. The word parameter is required.

Note

Displayed URLs (Like the ones shown on the API documentation page) and social links are hard-coded into the site. If you are self-hosting, be sure to replace these with your own data.

Discord Bot

The Discord Bot extension is in the folder ./src/extensions/discord-bot. Inside is a config.json file for your bot's configuration, and a .env file for your bot's token. subscribers.db is a database of subscribed server channels and DMs.

The Discord bot includes a variety of commands for both WOTD users and administrators. User commands use slashes, while admin commands use the "! " suffix.

Users may use basic query and config commands: Demonstration 0 Demonstration 1

Admins have access to advanced commands unavailable to regular users:

  • append {word} {ipa} {pos} {definition} {date}: Appends a new word to the words.db database. The {date} argument is optional and defaults to the day after the last date set in the table.
  • monitor: Returns information on the hosting computer's specs and performance.
  • query_next: Queries tomorrow's Word of the Day.
  • set_wotd {word} {ipa} {pos} {definition}: Sets the current Word of the Day.
  • test_send: A function to test the message sent to Word of the Day subscribers.

Self-Hosting

Caution

By default, both the website and API will be hosted by starting the script. To change this, you may edit the site configuration settings at ./src/extensions/site/config.json.

Linux:

git clone https://github.com/gaming-gaming/Word-of-the-Day.git
cd Word-of-the-Day
pip install -r requirements.txt
bash start.sh

Windows:

git clone https://github.com/gaming-gaming/Word-of-the-Day.git
cd Word-of-the-Day
pip install -r requirements.txt
start.bat

Thank you for using Word of the Day!

About

Word of the Day is a free and open-source service that posts interesting and uncommon words daily.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published