An open API service indexing awesome lists of open source software.

https://github.com/orgoldfus/fomo

Read the latest tech news right from your terminal
https://github.com/orgoldfus/fomo

cli hacktoberfest javascript news technology

Last synced: about 1 year ago
JSON representation

Read the latest tech news right from your terminal

Awesome Lists containing this project

README

          

fomo logo


Got FOMO? read the latest Tech news right from your Terminal


fomo example

![npm](https://img.shields.io/npm/v/fomoapp)

## Install
```sh
npm install -g fomoapp
```

## Usage
```sh
$ fomo
```

Select a specific source using the `-s` flag:
```sh
$ fomo -s hn # Hacker News
```

You can also select a specific ordering/sub-group using the `-t` flag:
```sh
$ fomo -s hn -t ask # ask HN
```

Limit the number of responses (for each source) using the `-l` flag:
```sh
$ fomo -l 3 # showes 3 entries for each source
```

Configure fomo using the `-c` flag:
```sh
$ fomo -c # openes the configuration menu
```

List all available sources (and their types) using the `-p` flag:
```sh
$ fomo -p # prints all available sources
```

Get help using the `-h` flag:
```sh
$ fomo -h
```

## Sources
| Source | Source ID | Available types |
|-------------- |----------- |----------------------------------------------------------------------------------------------------------- |
| Hacker News | hn | ask (Ask HN)
best
jobs
new
show (Show HN)
top |
| Product Hunt | ph | featured
new
top_ranking
top_votes |
| TechCrunch | tc | euro
funding
gear
mobile
social
startups
top |
| The Verge | verge | breaking
culture
full
mobile
sw (Software and Apps)
web |
| Reddit | reddit | fed (r/Frontend)
js (r/javascript)
prog (r/programming)
tech (r/technology)
webdev (r/webdev) |
| Wired | wired | business
gear
science
top |

## User-defined RSS sources (New!)
You can define your own RSS sources using simple configuration files.

In order to configure a new RSS source you'll need:

1. Create a new folder to hold your source configuration files.
2. Create a configuration file for your desired source.
3. Tell fomo where to find your config files:
* Open fomo's config menu (run `fomo -c`)
* Choose "Configure external rss feeds directory"
* Enter the path to the folder you created. Make sure to use an absolute path

### Source configuration file
Source configuration file should be a valid JSON file with the following structure:
```json
{
"details": {
"name": "The source name",
"id": "The source ID"
},
"baseUrl": "base URL of the RSS feeds",
"fetchTypes": {
"key1": "First RSS feed name",
"key2": "Second RSS feed name",
"keyN": "Nth RSS feed name"
},
"defaultFetchType": "Key name of the default RSS feed (should be one the keys defined above)",
"fieldsMapping": {
"title": "title field name",
"link": "link field name",
"summary": "summary field name (optional)",
"date": "date field name (optional)",
"author": "author field name (optional)"
},
"defaultCacheTTL": "Number of minutes to cache result from this source (optional. default is 10 minutes)"
}
```

The final RSS feed URL is built in the following way: `${baseUrl}/${selectedFetchTypeValue}`, so make sure `baseUrl` doesn't end with a comma and that non of the fetchTypes keys' values doesn't start with a comma.

For your convenience, here's an example source config file:
```json
{
"details": {
"name": "MIT News",
"id": "mit"
},
"baseUrl": "https://news.mit.edu/topic",
"fetchTypes": {
"astronauts": "mitastronauts-rss.xml",
"ai": "mitartificial-intelligence2-rss.xml"
},
"defaultFetchType": "ai",
"fieldsMapping": {
"title": "title",
"link": "link",
"summary": "summary",
"date": "isoDate",
"author": "author"
},
"defaultCacheTTL": 10
}
```

## License
[MIT](LICENSE)