Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions LICENSES/defusedxml==0.7.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------

1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.

2. Subject to the terms and conditions of this License Agreement, PSF
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python
alone or in any derivative version, provided, however, that PSF's
License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative
version prepared by Licensee.

3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.

4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.

5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.

8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

### 背景・目的

Bloggerで公開した記事のURLをGoogle Indexing APIに自動通知し、インデックス登録作業を自動化するためのバッチプログラムです。Firestoreで各URLの通知日時を管理し、結果をメールで通知します。
サイトマップから取得した記事URLをGoogle Indexing APIに自動通知し、インデックス登録作業を自動化するためのバッチプログラムです。Firestoreで各URLの通知日時を管理し、結果をメールで通知します。

### 機能一覧

- Blogger APIから全記事URLを取得し、FirestoreのURLを事前取得したキャッシュと突き合わせて登録・管理します。
- サイトマップから全記事URLを取得し、FirestoreのURLを事前取得したキャッシュと突き合わせて登録・管理します。
- Firestoreで各URLの通知日時を管理し、通知日時が古い順に指定件数だけURLを抽出してGoogle Indexing APIへ通知します。
- 通知結果をHTML形式でまとめ、指定アドレスへメール送信します。
- 各種設定値は環境変数で管理します。
Expand All @@ -18,8 +18,7 @@ Bloggerで公開した記事のURLをGoogle Indexing APIに自動通知し、イ

| 変数名 | 用途 |
| ---- | ---- |
| BLOGGER_INDEX_REGIST_API_KEY | Blogger APIキー |
| BLOG_ID | 対象ブログのID |
| SITEMAP_URL | サイトマップURL(通常は sitemap.xml など) |
| MAIL_FROM | 送信元メールアドレス(Gmail) |
| MAIL_PASSWORD | 送信元メールアドレスのアプリパスワード |
| MAIL_TO | 通知先メールアドレス |
Expand All @@ -42,7 +41,7 @@ Bloggerで公開した記事のURLをGoogle Indexing APIに自動通知し、イ

### 入力

- Blogger APIから取得した記事URL
- サイトマップから取得した記事URL
- Firestoreコレクション `url_notifications`

### 出力
Expand Down Expand Up @@ -73,7 +72,7 @@ python blogger_register/blogger_register.py

1. 環境変数から各種設定値を取得
2. Google認証セッションを初期化
3. Blogger APIから記事URL一覧をFirestoreに登録
3. サイトマップから記事URL一覧をFirestoreに登録
4. Firestoreから通知日時が古い順に指定件数だけURLを抽出
5. Google Indexing APIへ通知し、結果をFirestoreに反映
6. 全通知結果をHTMLメールで送信
Expand Down Expand Up @@ -118,6 +117,7 @@ python blogger_register/blogger_register.py
| cachetools | 5.5.2 | Apache License 2.0 |
| certifi | 2025.6.15 | Mozilla Public License 2.0 |
| charset-normalizer | 3.4.2 | MIT License |
| defusedxml | 0.7.1 | Python Software Foundation License 2.0 |
| google-api-core | 2.25.1 | Apache License 2.0 |
| google-api-python-client | 2.175.0 | Apache License 2.0 |
| google-auth | 2.40.3 | Apache License 2.0 |
Expand Down
Loading