Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
icelam committed Jul 1, 2022
2 parents a3790a4 + 82ea0b6 commit 6a2ffd7
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Fetch question of today from Leetcode's GraphQL API and send it to Telegram chan

### Tech Stack
* Python 3
* [Serverless@2.63.0](https://www.npmjs.com/package/serverless)
* [Serverless](https://www.npmjs.com/package/serverless)
* AWS Lambda
* AWS CloudFormation - Used by Serverless when doing deployment
* AWS CloudWatch - Automatically Setup by Serverless when doing deployment
Expand Down
2 changes: 1 addition & 1 deletion app/utils/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def convert_sub(self, el, text, convert_as_inline):
return f'_{text}' if text.strip() else text

def convert_sup(self, el, text, convert_as_inline):
return f'^{text}'
return f'^{text}' if text.strip() else text

def convert_a(self, el, text, convert_as_inline):
el['href'] = re.sub(r'\(', '%28', el['href'])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.4",
"description": "Push notification to Telegram channel for Leetcode's question of today",
"dependencies": {
"serverless-python-requirements": "^5.1.1"
"serverless-python-requirements": "^5.4.0"
},
"scripts": {},
"author": "Ice Lam",
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python-telegram-bot==13.7
pylint==2.11.1
requests==2.26.0
python-telegram-bot==13.13
pylint==2.14.4
requests==2.28.1
markdownify==0.10.0
17 changes: 8 additions & 9 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

service: leetcode-daily-question-telegram-bot

frameworkVersion: "2"
frameworkVersion: "3"

provider:
name: aws
runtime: python3.9
lambdaHashingVersion: 20201221
environment:
TELEGRAM_TOKEN: ${env:TELEGRAM_TOKEN}
TELEGRAM_CHAT_ID: ${env:TELEGRAM_CHAT_ID}
Expand All @@ -21,13 +20,13 @@ functions:
- schedule: cron(1 0 * * ? *)

package:
exclude:
- venv/**
- node_modules/**
- '**/__pycache__/**'
- .github/**
- .editorconfig
- .nvmrc
patterns:
- '!venv/**'
- '!node_modules/**'
- '!**/__pycache__/**'
- '!.github/**'
- '!.editorconfig'
- '!.nvmrc'

# Handling python packages: https://www.serverless.com/blog/serverless-python-packaging
plugins:
Expand Down
Loading

0 comments on commit 6a2ffd7

Please sign in to comment.