If necessary install the dev dependencies with npm install --include=dev.
Clone this repo and cd into it. Then run:
npm install
npm linkThen cd to the node.js project that is going to host this package and run this:
npm link fedialgoIf you set the environment variable FEDIALGO_DEBUG=true a lot more debugging info will be printed to the browser console. You can set this and other environment variables permanently by creating a .env file. See .env.example for other environment variables you can play with.
For changes to propagate you must run npm run build to generate changes to files in dist/ and then check those files into git (it's terrible, I know).
npm run buildThere's a pre-commit git hook that runs npm run build whenever you git commit but unfortunately it doesn't seem to actually run before the commit :(
To deploy documentation changes run ./deploy_documentation.sh.
To add a new metric for scoring toots you must:
- Add an entry to the
ScoreNameenum - Create a new subclass of
Scorer - Add a default weight for your scorer to
DEFAULT_WEIGHTS - Instantiate an instance of your new
Scorerin the appropriate array inTheAlgorithm(tootScorersif it's a self contained score that requires only the information in a single toot,feedScorersif it's a scorer that requires the entire set of timeline toots to score a toot)