# ローバーカレンダー ドキュメント
===
使い方
---
- [予定の確認](/8C2oQEG5QqCG0ykDcg-tlw)
- [オフライン機能](/mGlquloyRUqt9BISOTEkng)
- [イベントの登録](/S8KdSA6AR4u8tr87gQyDOA)
- [エラー報告・お問い合わせ](/o7j40jICRyKJ7h0HvfoBgw)
開発者向け
---
- [概要](/g_lZKPjpSKSJVyY_ANF_Fw)
- [コンセプト](/b6d9-rPUQUGS0qlMdE092w)
- [ローカルデバッグ](/nFTRz9fzQZu4ECM2HqZyKA)
- [ロードマップ](/hraVtMUBQUiAA5PwA5Hi-w)
その他
---
- [サイト運営ポリシー](/PUuEBaJbQX-wZ_2w5IBCwQ)
- [ライセンス](/18mdbK2FTu6Htr5WtagkzQ)
<!--
## Functions
- fetch google calendar (as ics)
- rendar calendar (via fullcalendar)
- receive request about adding event
## frontend
### UI framework
<a href="https://bulma.io/"><img src="https://img.shields.io/badge/Bulma-v.1.0.0-brightgreen?logo=bulma"></a>
### JS library
<a href="https://fullcalendar.io/"><img src="https://img.shields.io/badge/FullCalendar-v.6.1.11-blue"></a>
## backend
- nodejs
- node-fetch
- ics
- google calendar
## [Funcions] fetch google calendar (as ics)
every 3 hours, github actions run ```fetch-calendar.js``` on nodejs and export event as json format in the ```./backend``` directroy
```javascript!
// fetch-calendar.js
import fs from 'fs';
import fetch from 'node-fetch';
import ical from 'ical';
async function fetchAndSaveCalendar() {
const url = 'https://calendar.google.com/calendar/ical/27368b164f2ff54d4b7f165793fba4d2ef0706b2de617768c8c030ad0500e14c%40group.calendar.google.com/public/basic.ics';
try {
const response = await fetch(url);
const data = await response.text();
const parsedData = ical.parseICS(data);
const events = Object.values(parsedData).filter(e => e.type === 'VEVENT');
fs.writeFileSync('calendar.json', JSON.stringify(events, null, 2));
console.log('Calendar data updated successfully.');
} catch (error) {
console.error('Failed to fetch or save calendar data:', error);
}
}
fetchAndSaveCalendar();
```
```yaml!
name: Update Calendar Data
on:
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
jobs:
fetch-calendar:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Install dependencies
run: npm ci
working-directory: ./backend
- name: Fetch and parce ICS
run: |
node fetch-calendar.js
working-directory: ./backend
- name: Commit and push if changes
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add -A
git commit -m "Updated calendar data" || exit 0
git push
```
## [Functions] rendar calendar (via FullCalendar)
## PWA Support
### manifest.json
-->
{"title":"Rover Calendar","description":"fetch google calendar (as ics)","contributors":"[{\"id\":\"821c2b51-8523-43c4-b213-06fa49e178f0\",\"add\":2820,\"del\":64}]"}
ローバーカレンダー ドキュメント
使い方
開発者向け
その他