https://github.com/ournet/news-sources
A repository of news sources for every country
https://github.com/ournet/news-sources
data news news-sources sources
Last synced: 4 months ago
JSON representation
A repository of news sources for every country
- Host: GitHub
- URL: https://github.com/ournet/news-sources
- Owner: ournet
- Created: 2018-07-27T19:16:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-20T12:31:14.000Z (about 2 years ago)
- Last Synced: 2025-06-16T05:19:02.809Z (5 months ago)
- Topics: data, news, news-sources, sources
- Language: TypeScript
- Size: 753 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# news-sources
A repository of news sources for every country. Data is stored in JSON files.
## Node.js usage
```ts
import { getSources, getSource } from 'news-sources';
const sources = await getSources('ru'); // Russian sources
const source = await getSource('ru', 'vesti.ru');
```
## Node.js API
### readSources(countryCode: string): Promise
Reads news sources from a JSON file by `countryCode` (2 letters country code).
Data is not cached.
### getSources(countryCode: string): Promise
Gets news sources from a JSON file by `countryCode` (2 letters country code).
Data is cached.
## Current countries
- `md` - Moldova
- `ro` - Romania
- `ru` - Russia
- `bg` - Bulgaria
- `in` - India
- `it` - Italy
- `hu` - Hungary
- `cz` - Czech Republic
- `es` - Spain
## Contributing
Files you can contribute are in `data/sources` directory.
Each file contains news sources for a single country.
You can add a new file or update existing ones.
Before commiting run `yarn validate` or `npm run validate` to validate the data.