External Term Feed for Zotonic
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind AlainODea:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dispatch
resources
README.mdown
mod_term_feed.erl

README.mdown

Zotonic External Term feeds

This module provides resource data in external term format using a RESTful interface identical to mod_atom_feeds.

Example Usage

This can be run from an EShell assuming play is available in /etc/hosts or your DNS:

f(Body), f(Resources),
{ok, {{_,_,_}, _, Body}} = httpc:request(get, {"http://play:8000/term/article", []}, [], [{body_format, binary}]),
{ok, Resources} = binary_to_term(Body).

Resources should be a proplist of form [{Id, RscProps}, {Id1, RscProps1}, ...].

Similarly, you can search for articles with Zotonic in their fulltext through the search interface:

f(Body), f(Resources),
{ok, {{_,_,_}, _, Body}} = httpc:request(get, {"http://play:8000/term/search?cat=article&text=Zotonic", []}, [], [{body_format, binary}]),
{ok, Resources} = binary_to_term(Body).