svgをリアルタイムでプレビューするサイトないかなと思ってさがしたら、MDNでできたよ。それだけ。
Googleカレンダーの予定をチャットツールに通知する(共通編)
目的
- Discordを最強の情報収集ツールにする256の方法(その1)などを読んでいる人がいれば、Discordにどんな情報でも保存しておきたいと思っているはず
- この記事では、Googleカレンダーの情報を1日分、チャットツールに書き込むGoogle Apps Scriptを作成する方法について説明します
- 未来のことは分からないですが、2023/07時点では無料です(クレジットカードも不要)
- 必要なもの: Google Apps Script(Googleアカウント), 通知対象のチャットツールのWebhook作成権限
- Google Apps Scriptプロジェクトの作成までこの記事で説明します
通知したいチャットツール(Discord, Slack)によって、次に参照する記事が変わります(この記事と、次の記事の手順に従って実行してください)
参考画像
目次
- 目的
- 目次
- 作業内容
- GoogleカレンダーのカレンダーIDを取得
- Google Apps Scriptプロジェクトの作成
- コードの貼り付け
- プロジェクト設定(カレンダーIDの設定)
- チャットツールによって違う部分
- 参考資料
TwitterっぽいものをScrapboxにまとめた
Twitterがきな臭くなってきたので、代替サイトっぽいものをまとめてみた。
基本的にMisskeyが多機能で楽しいのでそれを使えばいいと思うけれど、Pleromaが軽いという噂なので気になっている。
久々にrepl.itに来たらよくわからんMigrationされてて、Poetryが動かないと思ったけど、poetryとpoetry.lockが消えてたみたい
こんなのが表示されて、Nix?へMigrationされた。
新規プロジェクトだと、Terminalだとダメで、ShellだとPoetry動いたのでMigrateされたプロジェクトでやってみるがダメ。
poetry install
とかpoetry系のコマンドを実行すると、
以下のように、「idnaなんてモジュール見つからないよ?」とエラーになる。
$ ./start.sh Traceback (most recent call last): File "/home/runner/discord-xxxxxxx/venv/bin/poetry", line 5, in <module> from poetry.console import main File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module> from .commands.about import AboutCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module> from .check import CheckCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/check.py", line 2, in <module> from poetry.factory import Factory File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/factory.py", line 16, in <module> from .packages.locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/__init__.py", line 2, in <module> from .locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/locker.py", line 38, in <module> from poetry.utils.extras import get_extra_package_names File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/extras.py", line 7, in <module> from poetry.utils.helpers import canonicalize_name File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/helpers.py", line 11, in <module> import requests File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/__init__.py", line 147, in <module> from . import packages, utils File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/packages.py", line 16, in <module> locals()[package] = __import__(package) ModuleNotFoundError: No module named 'idna' Traceback (most recent call last): File "/home/runner/discord-xxxxxxx/venv/bin/poetry", line 5, in <module> from poetry.console import main File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module> from .application import Application File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module> from .commands.about import AboutCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module> from .check import CheckCommand File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/console/commands/check.py", line 2, in <module> from poetry.factory import Factory File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/factory.py", line 16, in <module> from .packages.locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/__init__.py", line 2, in <module> from .locker import Locker File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/packages/locker.py", line 38, in <module> from poetry.utils.extras import get_extra_package_names File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/extras.py", line 7, in <module> from poetry.utils.helpers import canonicalize_name File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/poetry/utils/helpers.py", line 11, in <module> import requests File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/__init__.py", line 147, in <module> from . import packages, utils File "/home/runner/discord-xxxxxxx/venv/lib/python3.8/site-packages/requests/packages.py", line 16, in <module> locals()[package] = __import__(package) ModuleNotFoundError: No module named 'idna' exit status 1
redditでも同じ事象のスレッドがあったけど、なんか誰も興味なさそう。 www.reddit.com
pip install
で地道にモジュールをインストールしていったら動いたけど、これ、なんなんだろう。
Nixになったから説明書読んでおけよ、みたいな雰囲気があったのにスルーしたのが悪かったのかな....。
最近あんまりrepl.itを使わなくなったから別にいいのだけど、他の人たちは困ってないのかなぁと疑問に思う。
解決編
と思っていたが、新規プロジェクトだとpoetryが普通に動いた。 そこで、poetryが使えない&poetry.lockが初期化?的な感じになっていることに気づいた。
試しに、以下のようにやっていくと普通にBotが動いた。
Migrationしてくれるのは嬉しいけど、poetry.lock
ごと移行してくれたらよかったのに。
もしくは、ちゃんとpoetry.lock
が消えてますぞ、と伝えてくれるか(英語でなんか言ってたのかもしれない...)。
pip install poetry poetry add discord-py-slash-command=1.2.0 discord.py==1.6.0 flask python-dotenv python-dateutil pycryptodome
*これは古いやつを動かしたいので、古めのやつをインストールしてる...。良い子は真似しないで
You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints とTwitter APIに言われて泣いている君へ(どうでも記事)
日本語版(Japanese Ver.)
一応、日本語の記事の下に、英語版の記事もおいておきます(たまに外国人の方も見ている気がするので)。
In case you are interested, the English version of the article is below.
- 日本語版(Japanese Ver.)
- English Ver.