Giter Site home page Giter Site logo

sudiptob2 / leet-easy Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 9.0 380 KB

Get notification when leetcode publishes an easy daily challenge and grab your leetcoins.

License: GNU General Public License v3.0

Python 100.00%
leetcode desktop-notification leetcode-daily-challenge leetcode-notification leetcode-easy hacktoberfest hacktoberfest2022

leet-easy's Introduction

LeetEasy



Desktop notification for easy daily challenges in leetcode.

We all know Leetcode's daily challenges are awesome ๐Ÿ˜Ž However, sometimes these challenges are quite difficult for people who are just starting out problem-solving ๐Ÿฅฒ
This tool will send desktop notification when an Easy daily problem is published. This way you won't miss any opportunity to grab some easy Leetcoins ๐Ÿช™ and stay motivated for the day ๐Ÿ”ฅ

Requirements

  • python >= 3.8

Installation

pip install leeteasy

run

Schedule leeteasy to send notification for easy leetcode problem at 14:30 (24 hours format time)

python -m leeteasy start 14:30 &

To add additional difficulty

python -m leeteasy start 14:30 --difficulty medium &

This will schedule leeteasy for Easy and Medium problem.

To stop leeteasy

python -m leeteasy stop

NOTE: By default leeteasy checks for scheduled task in every 1 hour/3600 seconds. So there might be 1-hour delay from the actual scheduled time while getting the notification. However, this can be controlled using --sleep_duration option.

Linux cronjob guide

Set a cronjob to automatically start leeteasy at system boot.

# open cronjob editor
crontab -e

# add the following line
@reboot python -m leeteasy start 14:30 &

Contributing

We are very happy to see you here. Before sending your pull requests, make sure that you read the whole workflow and the naming conventions mentioned in the contributing guidelines.

If you have any doubts regarding the contributing guidelines, please feel free to state it clearly in an issue. All the best!

leet-easy's People

Contributors

chaitanya134 avatar hari-ajidesh avatar jaygala223 avatar kmartin62 avatar martin-cognitrek avatar nilesh05apr avatar queteddy avatar sudiptob2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leet-easy's Issues

add a PR template

A simple and brief PR template will help the contributors and maintainers while developing LeetEasy. I would like to add a simple PR template as below

example template

# Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# Checklist:

- [ ] branch name follows the branch naming convention mentioned [here](https://github.com/sudiptob2/leet-easy/blob/main/docs/BRANCH-NAMING.md)
- [ ] commit messages to follow the format mentioned in [contributing.md](https://github.com/sudiptob2/leet-easy/blob/main/docs/CONTRIBUTING.md)
- [ ] I have tested my code using `bash .github/check.sh`
- [ ] I have performed a self-review of my code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes

Add banner using canva

Add custom banner edited my me using canva
#hacktoberaccepted

please assign it to me with label

Handle missed notifications if the user's machine was powered on after the scheduled time had past

At the present situation to use leeteasy we schedule it using cronjob at the system startup like below, ref: docs

@reboot python -m leeteasy start 14:30 &  # we scheduled the notification at 14:30

Now, for example, the host machine was shut down at 14:30 and the user-powered has on his device at 15:00.
In this case he will miss the notification for the day as it's already past 14:30.

To handle this,
a check can be added before scheduling the Notifier. see here

if datetime.now().time() > validated_time:
    Notifier.notify()

we can get the validated time from the TimeValidator.validate(time) Ref: code

Add retry logic if can not connect to leetcode

In the current code, if leet-easy can not connect to leetcode API due to bad internet connectivity or any unknown issues, it does not retry.
Ref: here

I think a few retries would be better in such situations.

  • max retry: 3 times
  • Incremental interval ( first retry after 10 min, then 20 min, and then 30 min of sleep)

add a cool banner image in the readme

I am looking for a simple banner
some ref:

  • canva template. This template might be a ref point, but you have to use relevant props, text, etc. Also color combination must be chosen while keeping leetcode in mind.
  • Another repo chkware their banner is also pretty simple but effective

Change default application name

As leeteasy dpends on notify-py for desktop notification, the default application title in notify-py is "Python Application (notify.py)"

Change this title and put default title as,
LeetEasy - leetcode notification

ref: leeteasy/services/notification_service.py

A Logo/icon is required

To show an icon in the notification badge, we need a logo.
Keep the following concept/keywords while brainstorming for the icon ๐Ÿ™

  • leetcoins
  • leetcode logo
  • easy problem
  • notification

I see a lot of people are interested in this issue. If you want to work on this issue, make a PR with your design. Hopefully, I will merge the best one.

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.