Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "pl_omdb"

Title:API interface to OMDB (Open Movie Database)
Rating:Not rated. Create the first rating!
Latest version:0.5.0
SHA1 sum:bc5ef97af45431a45826e1cf53b65baae626e414
Author:Ebrahim Azarisooreh <ebrahim.azarisooreh@gmail.com>
Home page:https://github.com/eazar001/pl_omdb
Download URL:https://github.com/eazar001/pl_omdb/archive/v0.5.0.zip
Requires:typedef

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.1.1fe7234fa3dc43cbf22197b703f692c12b00deb521https://github.com/eazar001/pl_omdb/archive/v0.1.1.zip
0.1.22f900596521607134c298344fa055b3711f33ceb1https://github.com/eazar001/pl_omdb/archive/v0.1.2.zip
0.1.39eec74f996187f8497ee61115d50fe50cfb655161https://github.com/eazar001/pl_omdb/archive/v0.1.3.zip
0.1.44fc683b1f1a6272434c64c7050cbc23781608b806https://github.com/eazar001/pl_omdb/archive/v0.1.4.zip
0.2.029aa2d85743c3015b4804c6b2e670bcdc15af2c15https://github.com/eazar001/pl_omdb/archive/v0.2.0.zip
0.2.15c20e9765859ffdb655718dd70afee85c47fdeb42https://github.com/eazar001/pl_omdb/archive/v0.2.1.zip
0.3.0d3a0291d912bf9630cc2fd262b5359bb00b0b6af1https://github.com/eazar001/pl_omdb/archive/v0.3.0.zip
0.4.0f9a917c793c99764a3e220b71a7f58e5b368511d3https://github.com/eazar001/pl_omdb/archive/v0.4.0.zip
0.5.0bc5ef97af45431a45826e1cf53b65baae626e41419https://github.com/eazar001/pl_omdb/archive/v0.5.0.zip

pl-omdb

This is A SWI-Prolog interface to the OMDB (Open Movie Database) API http://www.omdbapi.com

Examples of Usage


% Loading pl_omdb will create a special API key flag to store the API key to be referenced later
?- use_module(library(pl_omdb)).

% The user can store the API key in the special flag for access at runtime now
?- set_prolog_flag(omdb_api_key, 'my_unique_key')

% This will fetch the release date for Casino Royale, year 2006.
?- omdb_fetch('Released'=Value, [title='Casino Royale',year='2006']).

% This will fetch the object that corresponds to Casino Royale, 2006, with all the keys
%  and respective values ... including results specific to Rotten Tomatoes.
?- omdb_fetch(Key=Value, [title='Casino Royale',year='2006',tomatoes='true']).

% Return list of search results along with number of results.
?- omdb_search(Key=Value, [title='The Matrix']).

% Iterate through all the search results while also unifying with the number of results found.
?- omdb_search_results(Key=Value, [title='The Matrix'], NumResults).

% Fetch the dictionary object for all titles matching "The Matrix".
?- omdb_fetch_dict(Dict, [title='The Matrix']).

% Fetch the dictionary object for search results pertaining to the title "The Matrix".
?- omdb_search_dict(Dict, [title='The Matrix']).

Alternatively, one may specify the API key in the above examples as a first argument, if they wish to bypass the flag mechanism and/or use multiple keys in one application.

The Options list is a list of valid parameters to pass to the OMDB API. All parameters are essentially key values that are of the type atom (described below). All of these keys correspond to a value (all represented as string types).

Here are some valid options for fetches/retrievals:

  • id
  • title
  • media_type (this is the OMDB 'type' parameter)
  • year
  • plot
  • tomatoes
  • callback
  • version ... And for searches:
  • title
  • media_type (this is the OMDB 'type' parameter)
  • year
  • page
  • callback
  • version For more information regarding the parameters visit the official website link posted at the top of this page.

Contents of pack "pl_omdb"

Pack contains 7 files holding a total of 12.9K bytes.