Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaandrle/randommdn
Posting a random article from MDN.
https://github.com/jaandrle/randommdn
cli css html javascript mastodon mastodon-bot mdn mdn-docs rss webdev
Last synced: 3 days ago
JSON representation
Posting a random article from MDN.
- Host: GitHub
- URL: https://github.com/jaandrle/randommdn
- Owner: jaandrle
- License: mit
- Created: 2023-06-01T12:20:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T08:34:24.000Z (25 days ago)
- Last Synced: 2024-12-17T00:28:52.906Z (7 days ago)
- Topics: cli, css, html, javascript, mastodon, mastodon-bot, mdn, mdn-docs, rss, webdev
- Language: JavaScript
- Homepage: https://front-end.social/@randomMDN
- Size: 65.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# randomMDN
This repository posts a random article from [MDN Web Docs](https://developer.mozilla.org/en-US/).
It is also a npm package exporting method `randomMDN`.For automatic posting, the [GitHub Action](https://docs.github.com/en/actions) is used,
see [`.github/workflows/scheduled-posts.yml`](./.github/workflows/scheduled-posts.yml).Inspired by [Random MDN (@randomMDN) / Twitter](https://twitter.com/randomMDN).
## Mastodon
You can find the bot on [randomMDN (@[email protected]) - Front-End Social](https://front-end.social/@randomMDN).## RSS
You can find the rss feed on [front-end.social/@randomMDN.rss](https://front-end.social/@randomMDN.rss)[^MaR].## NPM & CLI
1. Instalation (for now for early adapters)
1. latest *lts* version of NodeJS ⇒ for installation follow [nvm-sh/nvm: Node Version Manager](https://github.com/nvm-sh/nvm)[^ORnpm]
1. `npm install https://github.com/jaandrle/randomMDN --location=global`
1. usage cli
```bash
>_:randomMDN --helpDescription
This script posts a new random article from MDN¹ to a given mastodon instance.
To post to the correct mastodon instance, use the `--url` and `--token` options.
The script has been highly inspired by the similar project² for Twitter.
[1] https://developer.mozilla.org/en-US/
[2] https://github.com/random-mdn/random-mdn-botUsage
$ randomMDN [options]Available Commands
json Print random article as JSON
echo Print random article
text Print random article as text – default
mastodon Post to mastodon
rss Prints RSS feed for beeing used for example in [Newsboat, an RSS reader](https://newsboat.org/).For more info, run any command with the `--help` flag
$ randomMDN json --help
$ randomMDN echo --helpOptions
-v, --version Displays current version
-h, --help Displays this message
```
1. usage package: `import { randomMDN } from "randomMDN";`## Acknowledgments
- [random-mdn/random-mdn-bot: Serverless functions tweeting/sending/... random MDN articles](https://github.com/random-mdn/random-mdn-bot)
- [A Beginner's Guide to the Mastodon API - Post a Status Update with cURL or Python - DEV Community](https://dev.to/bitsrfr/getting-started-with-the-mastodon-api-41jj)
- [Simple Mastodon bot in 100 lines.](https://gist.github.com/NeKzor/e7d8551c4f55fbe4ec16252e0f6fa012)[^MaR]: FYI: [Mastodon and RSS](https://derekkedziora.com/notes/20221112094802)
[^ORnpm]: Alternatively `curl -sL install-node.vercel.app/lts | bash`