mandelbro/engine — pull request #1 by TheDahv (2014-09-06 23:20:28+00:00)
Title: Consume SWOOP API data in Locomotive CM via Liquid

Supports the `events` and `people` API endpoints from SWOOP.

You *must* set up your environment before using the tag. Locomotive compiles and caches the template when the tag is used, closing over any existing environment variables.

`consume_swoop` uses the following environment variables to build the API calls:

- `SWOOP_URL` - (Optional) - Set the URL base for the API call. Defaults to `https://swoop.up.co`
- `SWOOP_USER` - Required - Used for Basic Auth user to hit the SWOOP API. Get the value from an UP Engineer
- `SWOOP_PASS` - Required - Used for Basic Auth password to hit the SWOOP API. Get the value from an UP Engineer

View the `swoop_event_terms` and `swoop_people_terms` to see the available search terms for each API endpoint.

Snippet for example usage:

```liquid

Tonight we dine in hell

{% consume_swoop events from "events" city: "Seattle", since: "2014-01-01" %}
{% for event in events %}

{{ event.start_date | date: "%m-%d-%Y" }}
—
{{ event.city }} {{ event.vertical }}

{% endfor %}
{% endconsume_swoop %}

{% consume_swoop staff from "people" roles: "Core Team" %}
{% for person in staff %}

{{ person.first_name }} {{ person.last_name }} – {{ person.job_title }}
—
{{ person.twitter_handle }}

{% endfor %}
{% endconsume_swoop %}

```