Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
/ newsie Public archive

Elixir client library for fetching news headlines

Notifications You must be signed in to change notification settings

mroach/newsie

Repository files navigation

Newsie

Tests Linter

Newsie is a library for accessing APIs that provide news articles.

Installation

Newsie is available on hex.pm.

You can either add it as a dependency in your mix.exs.

To add it to a mix project, just add a line like this in your deps function in mix.exs:

defp deps do
  [
    {:newsie, "~> 0.1.0"}
  ]
end

Providers

Support for the following providers is built into Newsie:

Configuration

News APIs require authentication, usually with a simple API key/token. Check the documentation for each provider and the configuration provider Newsie.Config.

Configuration can be set with Elixir application config or with environment variables.

For example if you're configuring the NewsApi provider which requires an api_key.

App config

config :newsie, Newsie.Providers.NewsApi, api_key: "my_api_key"

Environment variable

The format of the environment variable is NEWSIE_ followed by the provider name and parameter name snake-cased. NEWSIE_<provider>_<param>.

NEWSIE_NEWS_API_API_KEY=my_api_key

Usage

Since each provider has different capabilities and ways of fetching news, there's currently no unified or standard interface to querying in a provider-agnostic way. Check the documentation for each provider to see how to use them.

  • Newsie.Providers.CurrentsApi
  • Newsie.Providers.NewsApi
  • Newsie.Providers.Newsriver

About

Elixir client library for fetching news headlines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published