Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yjszk committed Nov 14, 2023
0 parents commit b394f6f
Show file tree
Hide file tree
Showing 18 changed files with 1,368 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/delete-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: gamble cal delete
on:
workflow_dispatch:
inputs:
delete-date:
description: "削除開始日YYYYMMDD"
required: true
shubetu:
description: "削除対象"
required: true

jobs:
gamble:
name: gamble cal delete
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

defaults:
run:
shell: bash
working-directory: ./

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip" # caching pip dependencies

- name: create key dir
run: mkdir -p ./key/

- name: Translate secrets of base64 into key json
env:
JSON_DECODE: ${{ secrets.calkey }}

run: |
echo -n $JSON_DECODE | base64 --decode > ./key.json
- name: Translate secrets of base64 into setting.ini
env:
JSON_DECODE_INI: ${{ secrets.calsetting }}

run: |
echo -n $JSON_DECODE_INI | base64 --decode > ./setting.ini
- name: pip install
run: pip install -r requirements.txt

- name: gamble_cal_delete
id: gamble_cal_delete
run: |
python deleteUtil.py ${{ inputs.shubetu }} ${{ inputs.delete-date }}
55 changes: 55 additions & 0 deletions .github/workflows/monrhly-insert-kyotei.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: kyotei
on:
workflow_dispatch:

jobs:
gamble:
name: kyotei
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

defaults:
run:
shell: bash
working-directory: ./

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip" # caching pip dependencies

- name: create key dir
run: mkdir -p ./key/

- name: Translate secrets of base64 into key json
env:
JSON_DECODE: ${{ secrets.calkey }}

run: |
echo -n $JSON_DECODE | base64 --decode > ./key/key.json
- name: Translate secrets of base64 into setting.ini
env:
JSON_DECODE_INI: ${{ secrets.calsetting }}

run: |
echo -n $JSON_DECODE_INI | base64 --decode > ./setting.ini
- name: key validate
run: ls -lth ./key

- name: pip install
run: pip install -r requirements.txt

- name: gamble_cal_insert
id: gamble_cal_insert
run: |
python getJson.py `date '+%-m' -d "1 months"` `date "+%Y"` kyotei
python jsonToCal.py kyotei `date "+%Y"` `date '+%-m' -d "1 months"`
61 changes: 61 additions & 0 deletions .github/workflows/monrhly-insert-not-kyotei.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: keirin_keiba_autorace
on:
workflow_dispatch:

jobs:
gamble:
name: keirin_keiba_autorace
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

defaults:
run:
shell: bash
working-directory: ./

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip" # caching pip dependencies

- name: create key dir
run: mkdir -p ./key/

- name: Translate secrets of base64 into key json
env:
JSON_DECODE: ${{ secrets.calkey }}

run: |
echo -n $JSON_DECODE | base64 --decode > ./key/key.json
- name: Translate secrets of base64 into setting.ini
env:
JSON_DECODE_INI: ${{ secrets.calsetting }}

run: |
echo -n $JSON_DECODE_INI | base64 --decode > ./setting.ini
- name: key validate
run: ls -lth ./key

- name: pip install
run: pip install -r requirements.txt

- name: gamble_cal_insert
id: gamble_cal_insert
run: |
python getJson.py `date '+%-m' -d "1 months"` `date "+%Y"` keiba
python getJson.py `date '+%-m' -d "1 months"` `date "+%Y"` keirin
python getJson.py `date '+%-m' -d "1 months"` `date "+%Y"` autorace
python getJson.py `date '+%-m' -d "1 months"` `date "+%Y"` keiba_jra
python jsonToCal.py keiba `date "+%Y"` `date '+%-m' -d "1 months"`
python jsonToCal.py keirin `date "+%Y"` `date '+%-m' -d "1 months"`
python jsonToCal.py autorace `date "+%Y"` `date '+%-m' -d "1 months"`
python jsonToCal.py keiba_jra `date "+%Y"` `date '+%-m' -d "1 months"`
91 changes: 91 additions & 0 deletions .github/workflows/monrhly-insert-tiki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: tiki_insert
on:
workflow_dispatch:

jobs:
gamble:
name: tiki_insert
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

defaults:
run:
shell: bash
working-directory: ./

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip" # caching pip dependencies

- name: create key dir
run: mkdir -p ./key/

- name: Translate secrets of base64 into key json
env:
JSON_DECODE: ${{ secrets.calkey }}

run: |
echo -n $JSON_DECODE | base64 --decode > ./key/key.json
- name: Translate secrets of base64 into setting.ini
env:
JSON_DECODE_INI: ${{ secrets.calsetting }}

run: |
echo -n $JSON_DECODE_INI | base64 --decode > ./setting.ini
- name: key validate
run: ls -lth ./key

- name: pip install
run: pip install -r requirements.txt

- name: gamble_cal_insert
id: gamble_cal_insert
run: |
# 取得
items=(
keiba
keirin
kyotei
autorace
keiba_jra
)
for item in ${items[@]}; do
echo $tiki $item
python getJson.py `date '+%-m' -d "1 months"` `date "+%Y"` $item
done
# 確認
ls -lth
# 挿入
year=`date '+%-Y' -d "1 months"`
mouth=`date '+%-m' -d "1 months"`
tikis=(
kanto
tokai
hokuriku
kinki
tyugoku
kyushu
sikoku
hokkaido
tohoku
)
for tiki in ${tikis[@]}; do
for item in ${items[@]}; do
echo $tiki $item
python tikibetuCalInsert.py $year $mouth $item $tiki
done
done
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__/
*.json
.env
*.ini
.DS_Store
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# オケラカレンダー
## カレンダー
- [競技別オケラカレンダー](https://yjszk.github.io/gamble_calender/)
- [地域別オケラカレンダー](https://yjszk.github.io/gamble_calender/tikibetu.html)

## 使い方
- Jsonを取得する
```bash
#
python getJson 7 2022 keiba/keirin/kyotei/autorace/keiba_jra
```

- GoogleカレンダーからAPI経由で予定登録できるようにする
- サービスアカウント作って対応させる
- key.json,setting.iniを作って同一ディレクトリに入れる

- Googleカレンダーに登録する
```bash
#
python jsonToCal.py keiba/keirin/kyotei/autorace/keiba_jra
```

- Googleカレンダーの予定を削除する
- 指定した日を起点に現在まで全部削除する
```bash
#
python deleteUtil.py keiba/keirin/kyotei/autorac/keiba_jrae 2022 7 1 $dryrunOption
```
Loading

0 comments on commit b394f6f

Please sign in to comment.