{"id":21456045,"url":"https://github.com/etkecc/emm","last_synced_at":"2025-04-22T12:50:52.580Z","repository":{"id":253879037,"uuid":"841157793","full_name":"etkecc/emm","owner":"etkecc","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-15T10:45:05.000Z","size":2227,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T11:43:24.216Z","etag":null,"topics":["cli","matrix-org"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etkecc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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,"zenodo":null},"funding":{"liberapay":"etkecc"}},"created_at":"2024-08-11T20:06:22.000Z","updated_at":"2025-04-15T10:45:08.000Z","dependencies_parsed_at":"2024-08-20T05:54:42.994Z","dependency_job_id":"d0c7fbd1-fde7-417c-8c76-1f06f2728521","html_url":"https://github.com/etkecc/emm","commit_stats":null,"previous_names":["etkecc/emm"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etkecc%2Femm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etkecc%2Femm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etkecc%2Femm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etkecc%2Femm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etkecc","download_url":"https://codeload.github.com/etkecc/emm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250243828,"owners_count":21398405,"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":["cli","matrix-org"],"created_at":"2024-11-23T05:14:20.203Z","updated_at":"2025-04-22T12:50:52.574Z","avatar_url":"https://github.com/etkecc.png","language":"Go","funding_links":["https://liberapay.com/etkecc"],"categories":["Bots"],"sub_categories":["Administration"],"readme":"# emm: Export Matrix Messages\n\nA CLI tool that joins the room and exports last N messages to the file you specified.\n\n## Features\n\n* Get messages from any matrix room with pagination (if limit greather than page, to prevent timeout errors) or without it (if limit less or equals page)\n* Export messages to one file for all messages\n* Export each message in separate file\n* Custom templates supported (`contrib` contains an example of hugo post template, [etke.cc/news](https://etke.cc/news) can be used as reference)\n* Delegation and aliases supported\n* `Anyone`/`world_readable` access supported without invite\n\n## Usage\n\n### Full example\n\nThat's how [etke.cc/news](https://etke.cc/news) generated\n\n```bash\n# using event ID for filename\nemm -hs hs.url -u user -p pass -r \"#room:hs.url\" -t contrib/hugo-post-template.md -o /tmp/%s.md\n# using a custom slug for filename\nemm -hs hs.url -u user -p pass -r \"#room:hs.url\" -t contrib/hugo-post-template.md -o /tmp/{{ .CreatedAtDate }}.md\n```\n\n### Documentation\n\n```bash\nUsage of emm:\n  -hs string\n    \tHomeserver URL (supports delegation)\n  -l int\n    \tMessages limit\n  -o string\n    \tOutput filename. If it contains %s, it will be replaced with event ID (one message per file, old way), or you can use Go template syntax to use all fields (new way)\n  -p string\n    \tPassword of the matrix user\n  -r string\n    \tRoom ID or alias\n  -t string\n    \tTemplate file. Default is JSON message struct\n  -u string\n    \tUsername/Login of the matrix user\n```\n\n**Template syntax**\n\nYou can modify the output file name using Go template syntax. The following fields are available:\n\n* `{{ .ID }}` - event ID\n* `{{ .URLSafeID }}` - event ID with URL-safe encoding\n* `{{ .Replace }}` - old event ID that was replaced by this message\n* `{{ .ReplacedNote }}` - a simple ` (updated)` note if this message replaces another one\n* `{{ .Author }}` - author's MXID\n* `{{ .Title }}` - first line of the message with partially-stripped markdown\n* `{{ .Text }}` - full message text (markdown plain-text)\n* `{{ .HTML }}` - full message text (HTML, if available)\n* `{{ .CreatedAtDate }}` - created at date in 2006-01-02 format (date only)\n* `{{ .CreatedAt }}` - created at date in 2006-01-02 15:04:05 UTC format (date and time)\n* `{{ .CreatedAtFull }}` - created at date in default Go's representation format\n\nUsing those vars you could have output files likes:\n\n```\n-o /tmp/{{ .CreatedAtDate }}-{{ .Title }}.md\n```\n\nAll fields used in the output filename will be converted to URL-safe format, and the length of the filename will be truncated to 100 characters (to prevent filesystem errors).\n\n\n## How to get\n\n* Arch Linux [AUR](https://aur.archlinux.org/packages/export-matrix-messages-git/)\n* [Releases](https://github.com/etkecc/emm/releases)\n* or `go install github.com/etkecc/emm/cmd/emm@latest`\n* or `just install` from source code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetkecc%2Femm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetkecc%2Femm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetkecc%2Femm/lists"}