Skip to content

olefav/randnews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Randnews

Randnews is a made-for-fun tool for generating random news headers via Markov chains. Current news sources include the following websites:

UA

Prerequisites

In order to be able to launch the tool you need to have Elixir (tested on 1.16.0) + recent OTP installed.

Usage

Main functions of the Randnews tool are accessible via the Mix task of the same name. It has two main modes of operation: getting real news headers and generating new random ones.

Generating a file with news headers

In order to generate such file from the news sources listed in the description above you need to execute the following command:

mix randnews dump [options]

It has a shortcut version, "d" instead of "dump". The possible options are:

  • -f or --file, for a custom path for the file to be generated. By default it is "news.txt" in the current working directory
  • -n or --count, used for indicating approximate desired count of news to be fetched for every news source. Defaults to 50
  • -h or --help, for showing help message

Generating random news headers

The command is:

mix randnews generate [options]

It has a shortcut version, "g" instead of "generate". The possible options are:

  • -f or --file, for a custom path for the file to take news headers from. By default it is "news.txt" in the current working directory
  • -n or --count, for number of news headers to be generated. Default value: 20
  • -h or --help, for showing help message

Basic usage example

git clone https://github.com/olefav/randnews
cd randnews
mix deps.get
mix randnews d # for getting news headers
mix randnews g -n 50 # generate 50 new headers using data from the
previous step

Testing

mix test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages