Skip to content

Latest commit

 

History

History
58 lines (45 loc) · 2.47 KB

README.md

File metadata and controls

58 lines (45 loc) · 2.47 KB

randomMDN

This repository posts a random article from MDN Web Docs. It is also a npm package exporting method randomMDN.

For automatic posting, the GitHub Action is used, see .github/workflows/scheduled-posts.yml.

Inspired by Random MDN (@randomMDN) / Twitter.

Mastodon

You can find the bot on randomMDN (@[email protected]) - Front-End Social.

RSS

You can find the rss feed on front-end.social/@randomMDN.rss1.

NPM & CLI

  1. Instalation (for now for early adapters)
    1. latest lts version of NodeJS ⇒ for installation follow nvm-sh/nvm: Node Version Manager2
    2. npm install https://github.com/jaandrle/randomMDN --location=global
  2. usage cli
    >_:randomMDN --help
    
    Description
    	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-bot
    
    Usage
    	$ randomMDN <command> [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 --help
    
    Options
    	-v, --version    Displays current version
    	-h, --help       Displays this message
  3. usage package: import { randomMDN } from "randomMDN";

Acknowledgments

Footnotes

  1. FYI: Mastodon and RSS

  2. Alternatively curl -sL install-node.vercel.app/lts | bash