{"id":21091177,"url":"https://github.com/jadedctrl/sfeed_mastodon","last_synced_at":"2025-03-14T06:21:52.615Z","repository":{"id":207663806,"uuid":"719788009","full_name":"JadedCtrl/sfeed_mastodon","owner":"JadedCtrl","description":"Post feed data from sfeed to the fediverse. (🪞 Mirror)","archived":false,"fork":false,"pushed_at":"2024-01-30T06:00:35.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T01:13:30.346Z","etag":null,"topics":["atom","fediverse-bot","mastodon-bot","pleroma-bot","rss","sfeed"],"latest_commit_sha":null,"homepage":"https://hak.xwx.moe/jadedctrl/sfeed_mastodon","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JadedCtrl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-11-16T22:42:37.000Z","updated_at":"2024-01-30T06:12:07.000Z","dependencies_parsed_at":"2023-11-20T08:02:16.274Z","dependency_job_id":"d34e6046-f9ba-4acb-af9b-386d8a7cb317","html_url":"https://github.com/JadedCtrl/sfeed_mastodon","commit_stats":null,"previous_names":["jadedctrl/sfeed_mastodon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadedCtrl%2Fsfeed_mastodon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadedCtrl%2Fsfeed_mastodon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadedCtrl%2Fsfeed_mastodon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JadedCtrl%2Fsfeed_mastodon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JadedCtrl","download_url":"https://codeload.github.com/JadedCtrl/sfeed_mastodon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243532786,"owners_count":20306209,"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":["atom","fediverse-bot","mastodon-bot","pleroma-bot","rss","sfeed"],"created_at":"2024-11-19T21:43:59.293Z","updated_at":"2025-03-14T06:21:52.595Z","avatar_url":"https://github.com/JadedCtrl.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sfeed_mastodon\n\nMirror Atom/RSS feeds to Mastodon (\u0026 friends) simply and UNIX-ly.  \nMastodon-based front-end for the sfeed feed-reader.\n\n![A screenshot of a post to a Pleroma server. It is a post made by sfeed_mastodon, and contains an article title (“Kajtoj ne nur gajigas la ĉielon”), a URL (https://uea.facila.org/artikoloj/legaĵoj/kajtoj-ne-nur-gajigas-la-ĉielon-r394/), and a quoted excerpt from the URL (“Kajtoj estas ŝat-okupo kaj sporto en okcidentaj landoj, kaj ili estas eĉ pli gravaj en Azio. Tie ili estas tradiciaj, tre popularaj, kaj povas esti tre belaj artaĵoj. Cetere ili delonge utilas al sporto, veter-scienco, fotado kaj militad[…]”).](res/screenshot.png)\n\n\n\n## Usage\nsfeed_mastodon takes output from the lovely feed-aggregator\n[sfeed](https://codemadness.org/sfeed-simple-feed-parser.html) and posts it to the fediverse.  \nIt could be considered a front-end for sfeed.\n\nYou can use it to post an entire RSS feed like so:\n```\n$ FEDI_AUTH=\"yourAuthTokenHere\"\n$ sfeed https://planet.gnu.org/rss20.xml | sfeed_mastodon https://yourServer.here\n```\n\nIf you want to regularly update and mirror a feed — making it act like a normal RSS-repost bot — you\ncan run it like so (after some [configuration](#sfeed)):\n```\n$ FEDI_AUTH=\"yourAuthorizationTokenHere\"\n$ sfeed_update ~/.config/sfeedrc\n$ cat ~/.config/sfeed/* | sfeed_mastodon https://yourServer.here\n```\n\nIt’s that simple. It’s safe to run these commands several times in a row  — feed entries that have\nalready been posted won’t be reposted, if you use our `docs/sfeedrc.example` as your `sfeedrc`.\n\nFor proper automation, you can simply put these commands in a shell script and run it regularly.\nSuch a script has been provided, and is [described below](#mirror_feed) — `mirror_feed.sh`.\n\n\n## Installation\nFirst, make sure to install [sfeed](https://codemadness.org/sfeed-simple-feed-parser.html).\n\nIf Guix is your package manager:\n```\n$ guix install sfeed\n```\n\nNow, put ./sfeed_mastodon into your $PATH, somewhere. Assuming `~/.local/bin/`…\n```\n$ cp sfeed_mastodon ~/.local/bin/\n```\n\nYou’ve done it!\n\n\n\n## Configuration\n### sfeed\nIf you want to regularly update an RSS/Atom feed and post only new entries, we need to do some\nconfiguration for `sfeed_update`. For this, we’ve gotta create a config file and feed directory.\nYou should use the `docs/sfeedrc.example file` in this repo as a base for your own config file.\n```\n$ mkdir ~/.config/sfeed/\n$ cp docs/sfeedrc.example ~/.config/sfeedrc\n```\n\nYou need to edit the example sfeedrc to add in your own Atom/RSS feeds, or to change the feed path.\nYou can read up more on sfeed’s configuration in its man-page¸ sfeedrc(5).\n\nWarning: If you *don’t* use the provided `sfeedrc.example` as a base for your configuration, you\nwill probably end up reposting old entries — our `sfeedrc.example` only keeps the newest ones in\nthe file to avoid this. So please, use `sfeedrc.example`.\n\n\n### Mastodon\nNow, we need to find our authorization token for use with `sfeed_mastodon`.\n\nTo find your authorization token, you can snoop through request headers in Firefox or Chromium by\nnavigating to `Developer Tools (F12) → Network → Headers`. Refresh your Mastodon page and examine a\nrequest, looking for a header like so:\n\n`Authorization: Bearer $FEDI_AUTH`\n\n… where $FEDI_AUTH is your token. Copy it!\n\nWhenever you use sfeed_mastodon, make sure that this token is stored in the environment variable\n`$FEDI_AUTH`, or pass it with the `-a` parameter.\n\n\n### mirror_feed\nTo automatically mirror an Atom/RSS feed, you can make a script that runs `sfeed_update` \u0026\n`sfeed_mastodon`, and then put it in your crontab. `docs/mirror_feed.sh` is a script which does exactly this.\n\nTo use `mirror_feed.sh` with the `~/.config/sfeedrc` from our [prior configuration](#sfeed):\n```\n$ mirror_feed.sh ~/.config/\n```\n\n`mirror_feed.sh` has an additional config file: `sfeedenv`. It is a simple shell script that\nexports two variables: `$FEDI_SERVER` and `$FEDI_AUTH`. It will be sourced by `mirror_feed.sh`,\nthough you can optionally set these variables in the environment instead.\n\nBarring that, `mirror_feed.sh` expects a directory containing `sfeedrc` and a subdirectory `sfeed/`\nfor posts — just like the configuration in `~/.config` [discussed earlier](#sfeed).\n\n\n### Formatting\nYou might want to know about the template parameter (`-t`) — this lets you tweak the output for\nsfeed_mastodon as you wish. With this, you can add specific hash-tags to your posts, for example.\nIts argument should be HTML with some variables within {{double-cramps}} for post data. \n\nHere is an example, the default value:\n```\n\u003cb\u003e{{title}}\u003c/b\u003e\u003cbr\u003e\n{{url}}\u003cbr\u003e\n\u003cbr\u003e\n\u003cblockquote\u003e{{desc_short}}\u003c/blockquote\u003e\n```\n\nShort and sweet, right?\n\nHere are the variables you can use:\n* `title`\n* `url`\n* `desc`\n* `desc_short`\n\n\n\n## Misc.\nAuthor: [@jadedctrl:jam.xwx.moe](https://jam.xwx.moe/users/jadedctrl)  \nSource: https://hak.xwx.moe/jadedctrl/sfeed_mastodon  \nLicense: GPLv3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadedctrl%2Fsfeed_mastodon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjadedctrl%2Fsfeed_mastodon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadedctrl%2Fsfeed_mastodon/lists"}