Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
brainer3220 committed Dec 18, 2023
1 parent c916fc5 commit 293dda5
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 41 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ name: Deploy to Lambda with Zappa

on:
push:
branches:
- master
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: run venv
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: deploy with zappa
env:
AWS_ACCESS_KEY_ID: ${{ secrets.EVERY_CAL_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EVERY_CAL_SECRET_KEY_ID }}
run: |
zappa update dev
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: run venv
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: deploy with zappa
env:
AWS_ACCESS_KEY_ID: ${{ secrets.EVERY_CAL_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EVERY_CAL_SECRET_KEY_ID }}
run: |
zappa update dev
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Every2Cal은 Everytime μ‹œκ°„ν‘œλ₯Ό .ics ν˜•μ‹μœΌλ‘œ λ‚΄λ³΄λ‚΄μ£ΌλŠ” Python ν”„λ‘œκ·Έλž¨μž…λ‹ˆλ‹€.

Everytime μ•± 보닀 μΊ˜λ¦°λ”λ‘œ 일정을 κ΄€λ¦¬ν•˜λŠ”κ²Œ νŽΈν•œ λ§ˆμŒμ— 항상 Everytime μ‹œκ°„ν‘œλ₯Ό 수기둜 μΊ˜λ¦°λ”μ— 적곀 ν–ˆμŠ΅λ‹ˆλ‹€.

κ·Έ μˆ˜κ³ λ‘œμ›€μ„ 덜고자 κ°œλ°œν–ˆμŠ΅λ‹ˆλ‹€.

## μ–΄λ–»κ²Œ μ‚¬μš©ν•˜λ‚˜μš”?
Expand Down
1 change: 0 additions & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def get_calendar(self, timetable, start_date, end_date, id):
event.add('rrule', {'freq': 'WEEKLY', 'until': parser.parse(end_date)})
cal.add_component(event)


if len(str(cal.to_ical())) <= 39:
return None
else:
Expand Down
188 changes: 187 additions & 1 deletion everycal.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os

import boto3
import os
from flask import Flask
from flask import render_template
from flask import request
Expand Down Expand Up @@ -83,13 +82,16 @@ def privacy_policy():
def opensource_license():
return render_template('opensourcelicense.html')


@app.route('/robots.txt', methods=['GET'])
def robots_txt():
return render_template('robots.txt')


@app.route('/sitemap.xml', methods=['GET'])
def sitemap_xml():
return render_template('sitemap.xml')


if __name__ == '__main__':
app.run(host='0.0.0.0', port=8888, debug=False)
6 changes: 3 additions & 3 deletions static/javascript/GetTableXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function getTableXML(userid, password, semester, year) {
console.log("Call getTableXML function")

xmlHttp.onreadystatechange = function () {
if (this.status === 200 && this.readyState === this.DONE) {
console.log(xmlHttp.responseText)
}
if (this.status === 200 && this.readyState === this.DONE) {
console.log(xmlHttp.responseText)
}
}

// xmlHttp.open('CONNECT','https://everytime.kr', true)
Expand Down
10 changes: 6 additions & 4 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>EveryCal: μ—λΈŒλ¦¬νƒ€μž„ μ‹œκ°„ν‘œλ₯Ό λ‚˜μ˜ μΊ˜λ¦°λ”λ‘œ!</title>
{# <link rel="stylesheet" href="../static/css/OneUI-Web/oui.css">#}
{# <link rel="stylesheet" href="../static/css/OneUI-Web/oui.css">#}
<link rel="stylesheet" href="https://brainer-everycal-static.s3.ap-northeast-2.amazonaws.com/css/OneUI-Web/oui.css">
<meta name="description" content="μ—λΈŒλ¦¬νƒ€μž„μ˜ μ‹œκ°„ν‘œλ₯Ό ical ν˜•νƒœλ‘œ λ°”κΏ” μ›ν•˜λŠ” μΊ˜λ¦°λ” μ•±μ—μ„œ μ‚¬μš©μ΄ κ°€λŠ₯ν•΄μš”!">
<meta name="naver-site-verification" content="9704ef6a11cd925c2bd35f0ace81dfab4ed4484d" />
<meta name="naver-site-verification" content="9704ef6a11cd925c2bd35f0ace81dfab4ed4484d"/>
</head>
<body>
<main class="container">
Expand All @@ -25,7 +25,8 @@ <h1>ν•™κΈ°κ°€ μ‹œμž‘ν•˜λŠ” λ‚ κ³Ό λλ‚˜λŠ” 날을 λ„£μ–΄μ£Όμ„Έμš”.</h1>
<label for="start_date">μ‹œμž‘ν•˜λŠ” λ‚ </label>
</div>
<div class="input">
<input type="date" name="start_date" value="2023-03-02" id="start_date" class="input-text" placeholder="dd/mm/yyyy"
<input type="date" name="start_date" value="2023-03-02" id="start_date" class="input-text"
placeholder="dd/mm/yyyy"
required="required">
</div>
</div>
Expand All @@ -34,7 +35,8 @@ <h1>ν•™κΈ°κ°€ μ‹œμž‘ν•˜λŠ” λ‚ κ³Ό λλ‚˜λŠ” 날을 λ„£μ–΄μ£Όμ„Έμš”.</h1>
<label for="end_date">λλ‚˜λŠ” λ‚ </label>
</div>
<div class="input">
<input type="date" name="end_date" value="2023-06-22" id="end_date" class="input-text" placeholder="dd/mm/yyyy"
<input type="date" name="end_date" value="2023-06-22" id="end_date" class="input-text"
placeholder="dd/mm/yyyy"
required="required">
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions zappa_settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dev": {
"app_function": "index.app",
"aws_region": "ap-northeast-2",
"project_name": "every2cal",
"domain": "everycal.com",
"runtime": "python3.8",
"s3_bucket": "brainer-everycal-static"
}
"dev": {
"app_function": "index.app",
"aws_region": "ap-northeast-2",
"project_name": "every2cal",
"domain": "everycal.com",
"runtime": "python3.8",
"s3_bucket": "brainer-everycal-static"
}
}

0 comments on commit 293dda5

Please sign in to comment.