{"id":15016771,"url":"https://github.com/pascal-giguere/mastofeed","last_synced_at":"2025-06-13T09:05:48.088Z","repository":{"id":119619775,"uuid":"603921215","full_name":"pascal-giguere/mastofeed","owner":"pascal-giguere","description":"📬 Post new RSS feed items to Mastodon","archived":false,"fork":false,"pushed_at":"2025-02-17T00:17:28.000Z","size":4284,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T22:04:26.225Z","etag":null,"topics":["automation","bot","feed","mastodon","nodejs","rss","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mastofeed","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pascal-giguere.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-02-19T23:57:36.000Z","updated_at":"2025-03-30T00:50:26.000Z","dependencies_parsed_at":"2024-06-12T01:33:50.760Z","dependency_job_id":null,"html_url":"https://github.com/pascal-giguere/mastofeed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"pascal-giguere/starter-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascal-giguere%2Fmastofeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascal-giguere%2Fmastofeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascal-giguere%2Fmastofeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascal-giguere%2Fmastofeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascal-giguere","download_url":"https://codeload.github.com/pascal-giguere/mastofeed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248556963,"owners_count":21124156,"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":["automation","bot","feed","mastodon","nodejs","rss","typescript"],"created_at":"2024-09-24T19:49:21.843Z","updated_at":"2025-04-12T10:41:53.777Z","avatar_url":"https://github.com/pascal-giguere.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mastofeed 📬\n\nA Node.js library to post RSS feed items to Mastodon.\n\n- Syncs new RSS feed items and posts them from a Mastodon bot account.\n- Outputs rich, highly-customizable posts. Extract and transform any RSS item attribute.\n- Type-safe and entirely built with TypeScript.\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\u003cimg src=\"./screenshot.png\" width=\"598\" alt=\"Screenshot\" /\u003e\n\n*Automated post from [@lapresse@mastodon.quebec](https://mastodon.quebec/@lapresse) displayed in [Ivory](https://tapbots.com/ivory/mac/)*\n\n## Prerequisites\n\nMastofeed requires that you use a Mastodon bot account and generate an access token for it.\n\nTo do so, log into your Mastodon instance with your bot account, then go to Preferences \u003e Development and create a new\napplication with the `read:accounts`, `read:statuses` and `write:statuses` scopes. Take note of the access token\ngenerated for your application.\n\n## Installation\n\n```bash\nnpm install mastofeed\n```\n\n## Usage\n\nInstantiate a `Mastofeed` client, providing your Mastodon and RSS configuration.\n\nUse the `rss.postDef` property to define a mapping of RSS item attributes and customize the contents of your Mastodon\nposts.\n\n#### Basic example\n\n```js\nimport { Mastofeed } from 'mastofeed';\n\nconst feed = new Mastofeed({\n  mastodon: {\n    instanceUrl: 'https://mastodon.quebec',\n    accessToken: process.env.MASTODON_ACCESS_TOKEN,\n  },\n  rss: {\n    feedUrl: 'https://www.lapresse.ca/manchettes/rss',\n    postDef: {\n      id: { path: 'guid' },\n      title: { path: 'title' },\n      linkUrl: { path: 'link' },\n    },\n  },\n});\n```\n\n#### Advanced example\n\n```js\nimport {\n  Mastofeed,\n  UppercaseTransform,\n  BoldTransform,\n  MapTransform,\n  QuotationMarksTransform,\n  ItalicTransform,\n} from 'mastofeed';\n\nconst feed = new Mastofeed({\n  mastodon: {\n    instanceUrl: 'https://mastodon.quebec',\n    accessToken: process.env.MASTODON_ACCESS_TOKEN,\n  },\n  rss: {\n    feedUrl: 'https://www.lapresse.ca/manchettes/rss',\n    postDef: {\n      id: { path: 'guid' },\n      kicker: { path: 'title', regex: '^(.+) \\\\|', transforms: [new UppercaseTransform()] },\n      title: { path: 'title', regex: '(?!.*\\\\|) *(.+)?', transforms: [new BoldTransform()] },\n      category: {\n        path: 'link',\n        regex: '^https:\\\\/\\\\/www\\\\.lapresse\\\\.ca\\\\/(\\\\w+)\\\\/',\n        transforms: [\n          new MapTransform({\n            actualites: 'Actualités',\n            affaires: 'Affaires',\n            auto: 'Auto',\n            arts: 'Arts',\n            cinema: 'Cinéma',\n            contexte: 'Contexte',\n            debats: 'Débats',\n            gourmand: 'Gourmand',\n            international: 'International',\n            maison: 'Maison',\n            societe: 'Société',\n            sports: 'Sports',\n            voyage: 'Voyage',\n          }),\n        ],\n      },\n      description: {\n        path: 'contentSnippet',\n        transforms: [new QuotationMarksTransform(), new ItalicTransform()],\n      },\n      author: { path: 'dc:creator' },\n      linkUrl: { path: 'link' },\n    },\n    maxSyncedItems: 10,\n  },\n  logging: {\n    level: 'DEBUG',\n    prefix: 'La Presse',\n  },\n});\n```\n\n#### Publishing to Mastodon\n\nThen, to post all new RSS feed items to Mastodon from your bot account:\n\n```js\nawait feed.sync();\n```\n\n#### Full project example\n\nSee [Mastodon Québec Bots](https://github.com/pascal-giguere/mastodon-quebec-bots) for a full example of a project using Mastofeed.\n\n## Privacy\n\nMastofeed does not collect any analytics or telemetry data.\n\nThe addition of the `mfid` query parameter in URLs is strictly used to prevent duplicate posts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascal-giguere%2Fmastofeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascal-giguere%2Fmastofeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascal-giguere%2Fmastofeed/lists"}