https://github.com/tmpmachine/blogger-js-comment-section
https://github.com/tmpmachine/blogger-js-comment-section
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tmpmachine/blogger-js-comment-section
- Owner: tmpmachine
- Created: 2025-09-20T05:10:21.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-09-20T05:31:18.000Z (6 months ago)
- Last Synced: 2025-09-20T07:11:29.513Z (6 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blogger-js-comment-section
This loads Blogger post comments. Clicking the Reply button on each comment will show an embedded comment from to reply.

Tech:
- Blogger API v3
Requirements:
- Blogger API key
## How-To
Note: Implementation may vary.
Create a container for the comments:
```html
```
Then load the script after.
Update the following line with your API key:
```js
const API_KEY = '';
```
The blog ID and post ID should automatically set. But if it's not, e.g. due to template customization, you should provide it from here:
```js
const dataBlogId = $('._dataBlogId')?.textContent;
const dataPostId = $('._dataPostId')?.textContent;
const BLOG_ID = dataBlogId || $('head link[rel="service.post"]')?.href.split('feeds/')[1].split('/')[0];
const POST_ID = dataPostId || Array.from($$('head link[type="application/atom+xml"]')).find(e => e.href.includes('comments/default'))?.href.split('feeds/')[1].split('/')[0];
```