themoviedb-0.1.0.1: Haskell API bindings for http://themoviedb.org

Safe HaskellNone

Network.API.TheMovieDB.Util

Description

This module provides some helper functions for loading an API Key or complete Context from the user's environment or from the file system. Currently only POSIX systems are supported but patches are welcome!

Synopsis

Documentation

loadKey :: IO (Maybe Key)Source

Fetch an API Key from the first of:

  • TMDB_KEY environment variable
  • XDG_CONFIG_HOME/tmdbkey file (where XDG_CONFIG_HOME is an environment variable)
  • ~/.config/tmdbkey file
  • ~/.tmdbkey file

If the key can't be loaded from any of those places the result will be Nothing.

loadContext :: IO (Maybe Context)Source

Uses loadKey to fetch an API Key and wrap it into a default Context using mkContext.