Skip to content

RodEsp/daily-leetcode-bot

Repository files navigation

10

Daily Leetcode Bot

If you're a recurser, ping me on Zulip for any questions.
If you're a vertical flat plate, ping me on Slack for any questions.

The Daily Leetcode Bot can post questions from leetcode.com to Zulip or Slack every day.

It is primarily intended to be used for the Recurse Center but it can be easily configured to post with any frequency to any Zulip realm or Slack workspace.

Getting Started

To run this bot you must have Node.js installed.

Configuration

The bot can be configured by using the following environment variables:

  • Zulip

    • ZULIP_USERNAME - the e-mail address of your Zulip bot
    • ZULIP_API_KEY - the API_KEY of your Zulip bot
    • ZULIP_REALM - your Zulip Realm or the https address of your Zulip instance

    You can also place a zuliprc at the root of this repo.

  • Slack

  • Bot

    • DLB_TIMEZONE - A timezone identifier as defined by IANA (list here)
    • DLB_CRON_SCHEDULE - A cron expression as defined by node-cron
    • DLB_USER_ID - A Zulip user ID or a stream name
    • DLB_TOPIC - A Zulip topic name

Running

  1. Clone this repo
  2. Install dependencies
    1. npm install
  3. Run the bot
    1. npm start

Repo Overview

This repository is composed of three main files.

The business logic for the bot and where all the configuration gets applied.

GraphQL queries that can be used with the Leetcode API.
Unfortunately the Leetcode API is not documented but useful information about it can be found here, here, and by searching the intertubez.

A JSON dataset containing the problems found here which were compiled by the talented @yangshun.

Contributing

Please read our Code of Conduct

Please create an issue if you want to submit a PR and link it to your PR with one of these keywords.

Feel free to create issues for any bugs or feature requests. If submitting a bug, please include as many details as possible. Including, but not limited to, reproduction steps, logs, and screenshots that show the problem.

Releases

No releases published

Packages

No packages published