{"id":13638713,"url":"https://github.com/oom-components/mastodon-comments","last_synced_at":"2025-03-17T16:12:48.242Z","repository":{"id":185137713,"uuid":"673057556","full_name":"oom-components/mastodon-comments","owner":"oom-components","description":"Web component to show comments from mastodon and bluesky","archived":false,"fork":false,"pushed_at":"2024-12-03T16:12:57.000Z","size":33,"stargazers_count":40,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T07:34:55.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://oom-components.github.io/mastodon-comments/demo/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oom-components.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-31T19:16:12.000Z","updated_at":"2025-02-23T04:16:32.000Z","dependencies_parsed_at":"2024-12-03T17:23:11.687Z","dependency_job_id":"a48211f6-a350-4eaa-8f6f-4715ac62c386","html_url":"https://github.com/oom-components/mastodon-comments","commit_stats":null,"previous_names":["oom-components/mastodon-comments"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fmastodon-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fmastodon-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fmastodon-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fmastodon-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oom-components","download_url":"https://codeload.github.com/oom-components/mastodon-comments/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066189,"owners_count":20392406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:00:52.242Z","updated_at":"2025-03-17T16:12:48.213Z","avatar_url":"https://github.com/oom-components.png","language":"JavaScript","readme":"# Mastodon comments\n\nWeb component to show comments from Mastodon. Inspired by the work of\n[Thiago Cerqueira](https://thiagojedi.github.io/blog/activitypub-comments/) who\nhas inspired by\n[Julian Fietkau](https://fietkau.blog/2023/another_blog_resurrection_fediverse_new_comment_system),\nwho has inspired by\n[Cassidy James](https://cassidyjames.com/blog/fediverse-blog-comments-mastodon/),\nwho also was inspired by\n[Jan Wildeboer](https://jan.wildeboer.net/2023/02/Jekyll-Mastodon-Comments/) who\nwas inspired by\n[Yidhra Farm](https://yidhra.farm/tech/jekyll/2022/01/03/mastodon-comments-for-jekyll.html),\nwho was inspired by\n[Joel Chrono](https://joelchrono12.xyz/blog/how-to-add-mastodon-comments-to-jekyll-blog/)\nwho was inspired by\n[Carl Schwan](https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/).\n\nRecently I included support for Bluesky. Thanks to [Andy](https://pixelde.su/) for the idea and for [let me borrow his code](https://mastodon.gal/@pixel@desu.social/113569049052739770).\n\n- No dependencies\n- Light: ~300 lines of code (including comments and spaces)\n- Follows the **progressive enhancement strategy:**\n- Build with modern javascript, using ES6 modules and custom elements\n\n## Usage\n\n### HTML\n\nWrite the following HTML code with a link to a post from Mastodon and/or Bluesky:\n\n```html\n\u003coom-comments\n  mastodon=\"https://mastodon.gal/@misteroom/110810445656343599\"\n  bluesky=\"https://bsky.app/profile/lume.land/post/3lc3b4k2n6p2x\"\u003e\n  No comments yet\n\u003c/oom-comments\u003e\n```\n\n### JS\n\nRegister the custom element:\n\n```js\nimport Comments from \"./mastodon-comments/comments.js\";\n\n//Register the custom element with your desired name\ncustomElements.define(\"oom-comments\", Comments);\n```\n\n### CSS\n\nImport the CSS code from this package or create your own.\n\n```css\n@import \"./mastodom-comments/styles.css\";\n```\n\n## Customization\n\nYou can customize the HTML code generated by overriding the default\n`renderComment` static function:\n\n```js\nimport Comments from \"./mastodon-comments/comments.js\";\n\n// Customize the HTML rendering\nclass CustomComments extends Comments {\n  renderComment(comment) {\n    // your render here\n  }\n};\n\n//Register the custom element with your desired name\ncustomElements.define(\"oom-comments\", CustomComments);\n```\n\n## Cache\n\nUse the `cache` attribute to cache the API responses. It accepts a number with\nthe time in seconds. The cache is also used offline.\n\n```html\n\u003c!-- Cache for 1 minute (60 seconds) --\u003e\n\u003coom-comments\n  cache=\"60\"\n  mastodon=\"https://mastodon.gal/@misteroom/110810445656343599\"\n\u003e\n  No comments yet.\n\u003c/oom-comments\u003e\n```\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foom-components%2Fmastodon-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foom-components%2Fmastodon-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foom-components%2Fmastodon-comments/lists"}