Skip to content

Commit b638f51

Browse files
committed
modify: html link & static file link
1 parent 7cd493e commit b638f51

File tree

6 files changed

+56
-17
lines changed

6 files changed

+56
-17
lines changed

.github/workflows/worker.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Velog Dashboard Data Scrapper
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.10]
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
19+
- name: Install python package
20+
run: |
21+
pip install aiohttp
22+
pip install motor
23+
pip install pydantic
24+
pip install pytz
25+
pip install aiohttp-retry
26+
pip install python-dotenv
27+
pip install --upgrade google-api-python-client oauth2client
28+
29+
- name: Run main.py
30+
run: |
31+
python ./main.py ${{secrets.DB_RUL}} ${{secrets.PERIOD_MIN}}

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Velog Dashboard Project
22

3-
> velog dashboard project, ***velog의 모든 게시글, 통계 데이터를 한 눈에 편하게 확인하자!!***
3+
> velog dashboard project, ***velog의 모든 게시글, 통계 데이터를 한 눈에 편하게 확인하자!!*** - https://velog-dashboard.kro.kr/
44
55
## 1. HOW TO USE
66

7+
#### https://velog-dashboard.kro.kr/
8+
79
1. https://velog.io/ 에 접속해서 내 벨로그에 들어간다 (ex - https://velog.io/@qlgks1)
810

911
2. 개발자 도구 -> 어플리케이션 -> 쿠키 -> velog에서 `access_token` 값과 `refresh_token` 값을 확인한다!
@@ -14,6 +16,9 @@
1416

1517
5. 특히 게시글이 많은 경우, 오래된 게시글일 경우, retry로 데이터 스크레이핑을 해도 limit에 걸리는 경우가 있습니다. 이 경우 다음 데이터 스크레이핑 사이클에서 update가 되니, 기다려주시면 너무 감사드립니다.
1618

19+
6. 영상으로 보기! -> https://youtu.be/Ab8c4kmGhQA
20+
21+
7. 최초 로그인 이후, 다시 로그인 시도 하실때 `token issue` 로 고통받으신다면, 우측 하단에 채널톡으로 남겨주시면 제가 핸들링하겠습니다,, (아직 BETA 라 해당 부분은 조금 문제가 있습니다ㅠㅠ)
1722

1823
## 2. token 활용 사항과 사용하는 velog graphQL list
1924

nginx/pages/dashboard/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
<button id="navbar-toggle" class="navbar-toggle"></button>
6868
<nav class="sidebar">
6969
<ul>
70-
<li><a href="/dashboard/dashboard.html">My Dashboard</a></li>
71-
<li><a href="/index.html">Logout</a></li>
72-
<li><a href="/global/global.html">Global Dashboard (준비중)</a></li>
70+
<li><a href="/dashboard">My Dashboard</a></li>
71+
<li><a href="/">Logout</a></li>
72+
<li><a href="#">Global Dashboard (준비중)</a></li>
7373
</ul>
7474
</nav>
7575

nginx/pages/index/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<!-- Sweetalert2 -->
5555
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
5656
<!-- CUSTOM -->
57-
<link rel="stylesheet" href="index.css" />
57+
<link rel="stylesheet" href="./index.css" />
5858
</head>
5959
<body>
6060
<div class="login-container">
@@ -83,6 +83,6 @@
8383
<span id="login-container-footer">made by Nuung</span>
8484
</div>
8585
<script src="../global.js"></script>
86-
<script src="index.js"></script>
86+
<script src="./index.js"></script>
8787
</body>
8888
</html>

worker/main.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import os
3+
import sys
34

45
from dotenv import load_dotenv
56
from logger import LOGGER as log
@@ -9,8 +10,8 @@
910
from src.modules.velog_apis import fetch_posts, fetch_stats
1011

1112
load_dotenv()
12-
DB_URL = os.getenv("DB_URL")
13-
PERIOD_MIN = int(os.getenv("PERIOD_MIN"))
13+
DB_URL = os.getenv("DB_URL", sys.argv[0])
14+
PERIOD_MIN = int(os.getenv("PERIOD_MIN", sys.argv[1]))
1415

1516
if not DB_URL:
1617
raise Exception("There is no DB_URL value in env value")
@@ -86,12 +87,13 @@ async def main():
8687
continue
8788

8889

89-
async def run_periodically():
90-
while True:
91-
await main() # 메인 함수를 실행
92-
await asyncio.sleep(600) # 10분(600초) 동안 대기
90+
# async def run_periodically():
91+
# while True:
92+
# await main() # 메인 함수를 실행
93+
# await asyncio.sleep(600) # 10분(600초) 동안 대기
9394

9495

95-
# 이벤트 루프를 사용하여 run_periodically 함수 실행
96-
# asyncio.run(main())
97-
asyncio.run(run_periodically())
96+
# # 이벤트 루프를 사용하여 run_periodically 함수 실행
97+
# asyncio.run(run_periodically())
98+
99+
asyncio.run(main())

worker/token_refresh.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import os
3+
import sys
34

45
from dotenv import load_dotenv
56
from logger import TOKEN_REFRESH_LOGGER as log
@@ -8,8 +9,8 @@
89
from src.modules.velog_apis import fetch_posts, get_cookie_from_one_stats_api
910

1011
load_dotenv()
11-
DB_URL = os.getenv("DB_URL")
12-
PERIOD_MIN = int(os.getenv("PERIOD_MIN"))
12+
DB_URL = os.getenv("DB_URL", sys.argv[0])
13+
PERIOD_MIN = int(os.getenv("PERIOD_MIN", sys.argv[1]))
1314

1415
if not DB_URL:
1516
raise Exception("There is no DB_URL value in env value")

0 commit comments

Comments
 (0)