Deprecation Warning: The NPR Story API is no longer actively maintained. Stations wishing to share NPR content should use the NPR Content Distribution System instead. See also the NPR CDS module for ExpressionEngine.
The NPR Story API module wraps NPR's Story API Wordpress plugin in an ExpressionEngine module. By default, installation will create a default channel, required fields, and a publish layout suitable for pushing to and pulling from the NPR Story API.
The plugin also allows channel mapping, allowing existing channels to push to or pull from the story api.
- Clone the project as
npr_story_api
. Note: ExpressionEngine requires the project directory to be namednpr_story_api
. - From the command line, cd to the project directory.
- Run
php composer.phar install
.
- (Optional) From the Control Panel's Files interface, create an NPR Images file location and grant privileges to appropriate user groups.
- From Control Panel > Developer > Addons, install the plugin.
- Click the NPR Story API settings icon:
- Use your org's API key in the API Key field.
- Use your org's org ID in the Org ID field.
- Set the pull url (https://api.npr.org for production, https://api-s1.npr.org for NPR's api test environment).
- Set the push url as above. Note: API push requires IP address whitelist by NPR.
- Choose a file location for images from pulled stories.
- Choose channels to be mapped to the NPR api. (Start with the NPR Stories channel.)
- Save settings.
Mapped channels must have access to all fields required by the story api (NPR Story API field group), and be configured as mapped in the api settings. Channel naming conventions are strongly recommended.
- Create a new channel entry in a mapped channel.
- In the publish tab, add any title text.
- Switch to the Options tab
- Set story source to NPR.
- Set the NPR Story ID to the desired story.
- Click Overwrite Local.
- Click Save.
The story will be pulled and mapped to expression engine. The title and URL field will be overwritten by the remote story. Note that the URL will only be overwritten when creating a new story, not on edit. This prevents URLs from changing on live stories. All images will be stored in the Files location configured in the API settings.
Formatting changes can be preserved by saving without using the Overwrite Local switch.
If the story is correctly formatted, change story status from Draft to Open and click Save.
- Enter story as usual. See the NPR Story API documentation for guidance on story element use.
- Switch to the Options tab and set Status to Open.
- Save the story before pushing to prevent work from being lost on a failed push.
- Switch to the Options tab:
- Leave story source set to Local.
- Leave NPR Story ID blank.
- Click Publish to NPR.
- Optional: Click Send to NPR One to include the story on NPR One.
- Optional: Click NPR One Featured to request the story be featured in NPR One.
- Click Save.
If the story was pushed successfully, the story will be updated automatically with the NPR story ID.
To re-push a story, make corrections, update the Publication Date (Date tab), then click Save.
- ExpressionEngine 6+
- PHP 7+
- PHP curl module
- PHP xml module
- Composer
- NPR Story API Wordpress Plugin (via composer)
- don't delete tables on uninstall
- check for xml before stripping headers
- strip http headers from xml response
- correct EE7 filemanager reference format
- correct audio property checks
- add audio selection fallback
- set top level file manager check (WIP: plugin must use file manager compatibility mode)
- improve property checks on story mapping
- update openpublicmedia/nprapi-wordpress to v1.9.5.2
- check field availability on save
- check autofill values before using
- check several styles of error response
- update pub_date on save
- parse xml from raw npr error response
- check for story ID before exiting push
- check for npr response message before exiting push
- limit updater_3_0_0 column delete to php 8+
- remove type hints incompatible with php7
- php 8: correct pass-by-reference warnings
- php 8: correct argument type checking on api response
- php 8: correct required, optional param order
- breaking: remove EE audio columns (audio_type, audio_filesize, audio_format, audio_rights, audio_region, audio_rightsholder)
- breaking: update EE class namespace for v6
- autofill default audio permissions, duration, title
- changed preferred wysiwyg editor to wyvern
- update wordpress package to 1.9.5
- don't delete channels, fields, or statuses on uninstall
- increase column length for pulled story slugs and short_titles
- various: check variable state before using
- upgrade wordpress package to 1.9.4
- Correct version constant.
- Update connection error handling.
- Update install/uninstall methods for EE6 compatibility.
- Follow Open Public Media fork of nprapi-wordpress.
- Pin nprapi-wordpress to 1.9.2.
- Process only largest image crop on story pull.
- Make sure sideloaded images get a thumbnail.
- Fix grid fieldtype detection warning.
- Load required modules.
- Correct constant name.
- Update docs url.
- Move channel entry data assignment to public utility.
- add optional parameters to table loader class methods.
- Add config utility class.
- Bump version constant.
- Roll back 2.0.2.
- Check for invalid
pubDate
andstoryDate
values.
- Update
audioRunbyDate
format
- Don't display mapped channel error when autofilling media.
- Breaking change: Remove required column constraints on
npr_images
andaudio_files
fields. - Extract field utilities class.
- Autofill audio, image columns from media uploads on all mapped channels.
- On pull, fall back to entry url_title if generated url title is empty.
- Remove page-breaking debug code from pull function.
- Add byline splitting parameter to nprml mapper.
- Bugfix: Correct nprml author assignment in empty byline.
- Bugfix: Use unique partner ID.
- Bugfix: Use site_url + channel comment url + entry title as html permalink tag value on push.
- Push EE image manipulations as nprml image crops.
- Check for php extension dependencies on install and update.