Detailed Express RSS Feed Mapping
Map an RSS feed to Express metafields using FeedWordPress
Table of Contents
Pugpig Express can import your content directly from a standard RSS feed. Find out how below.
Note: Express supports the W3 RSS Standard fields out of the box, so any feed that adheres to this is good to go. (You can see a full list of the standard fields in the RSS feed spec, specifically in the Element of <item> section). Pugpig Professional, Connect or Toolkit customers can also use RSS but can also support custom feed imports.
RSS Feed
Example feed - Figure 1
<?xml version="1.0" encoding="UTF-8"?> <rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"> <channel> <title>Pugpig RSS Feed</title> <link>http://pugpig.com/feed/</link> <description>Content from Pugpig.com</description> <language>en-gb</language> <item> <title>Example Post 1</title> <guid isPermaLink="false">https://this.should.be.unique/and/never/change</guid> <link>http://www.pugpig.com/story1.html</link> <content:encoded>Lorem ipsum. Aliquam faucibus felis sed maximus rhoncus. Curabitur placerat, ipsum eu commodo pretium, tortor diam congue ligula, vitae porta eros velit ut massa. Etiam pretium ipsum vel tempor vulputate.</content:encoded> <category>News</category> <pubDate>Wed, 16 Sep 2015 13:47:56 GMT</pubDate> <updated>2015-11-02T15:55:50Z</updated> <media:description>My image description</media:description> <media:thumbnail url="http://post.pugpig.com/wp-content/uploads/2015/09/VW-wideBIG-thumb.jpg" width="90" height="60" /> <media:content type="image/jpg" url="http://post.pugpig.com/wp-content/uploads/2015/09/VW-wideBIG.jpg" /> <dc:creator>John Smith</dc:creator> </item> </channel> </rss>
Additional tags can be added to your RSS feed in order to map to information from your RSS feed to fields in express. Common available Pugpig mappings using FeedWordpress can be found below.
Common Express metafield mappings - Figure 2
Make it a habit to always add the guid mapping. We use this field for ordering timelines and also sometimes for canonical urls. Usually the mapping value for this field will be $(guid) but for some feeds it might be $(id). It never hurts having the metadata in the database, so ALWAYS MAP IT.
Full list of mappings
Header Group
- rss_title
- rss_standfirst
- rss_slug
- rss_taxonomy_contributor_{COUNT} (count is needed to order by, and assign meta)
- rss_taxonomy_contributor_{COUNT}_meta_byline
- rss_taxonomy_contributor_{COUNT}_meta_image_url_image
Main Media
- rss_image_url_main-media-image
- article-audio-external-source
- rss_main_caption (main image caption)
- rss_main_credit (main image credit)
- rss_main_video (Youtube or Brightcove url only)
- rss_image_url_main-media-video-poster-image
Timeline/TOC Images
- rss_image_url_pugpig_widgets_article_image_override (Bolt)
- rss_image_url_table-of-contents-icon-or-tile-image (deprecated, for Publish only)
- rss_toc_image_url (deprecated, for Publish only)
Taxonomies
- rss_edition_tag
- rss_taxonomy_sections
- rss_taxonomy_contributor
- rss_taxonomy_edition_tags
Misc
- guid
- sample
- pugpig_page_rank
- pugpig_language (This key will add a lang attribute onto every card in timelines containing the value. This is also the case for search results)
- rss_footer
- sharing_link
- meta-select (article layout/Express template)
- rss_template_full_width (full width template)
Editions
- rss_thumbnail_image_url (DEPRECATED: rss_edition_cover_url)
- edition_key
- edition_date
- pugpig_edition_itunes_app_id
- edition_draft
- edition_paid
- edition_order_by_type
General
- rss_image_url_{meta_key}
- rss_taxonomy_{taxonomy}
Taxonomy Meta
- rss_taxonomy_TAXONOMYSLUG_COUNT
- rss_taxonomy_TAXONOMYSLUG_COUNT_meta_METAKEY
- rss_taxonomy_TAXONOMYSLUG_COUNT_meta_image_url_METAKEY
- TAXONOMYSLUG is the slug of the taxonomy that you want to map to
- COUNT is the index of the specific taxonomy term
- METAKEY is the taxonomy term meta key that you want to map to
NB: FWP index begins at 1 instead of 0, so you'll be mapping rss_taxonomy_contributor_0 to $(dc:creator[1]) and rss_taxonomy_contributor_1 to $(dc:creator[2])
Deprecated
Author
- rss_author
- rss_author_byline
- rss_image_url_author-headshot
- pugpig_language (This key will add a lang attribute onto every card in timelines containing the value. This is also the case for search results)
Adding the feed
Setting up Field Mapping in Express is straightforward, and is done via the Syndication tab on the left hand menu. Click on this tab and you will see this page (no feeds currently set up):
Empty syndicated sites page - Figure 3
Enter the address of the feed in the Website or feed URI box on the top right and click Add ->. Click Use this feed on the Next page to add the feed to the list. You should now see this:
Syndicated sites page with feed - Figure 4
Mapping fields
Global level settings, i.e. 'default' mapping:
If the settings for all your feeds is going to be the same, save yourself time and use the 'defaults for all feeds' mapping. Click on 'Posts & Links' from the left-hand menu:
Per feed mapping
If you want to map each feed individually (because they need different mappings) then move your mouse over a syndicated site and several links will appear below the title, as seen in Figure 5. Click on the Posts tab.
Scroll down till you see the tab in Figure 6.
Custom post settings - Figure 6
This is where we will do the field mappings. For each field we want to map to we will need to enter the field name from the feed and the equivalent field in express. Some common fields can be found in Figure 2.
You will have to enter these one by one and save after each new field you map. Using the example feed as an example, this is what the result should look like:
Field mapping example - Figure 7
Updating the feed/Getting articles
Now that the fields are mapped, we can start to import content. Scroll back to the top of the page and click Update Now or return to the Syndicated sites page and click Update Now next to previously imported feed as shown in Figure 4.
The contents of the feed should be pulled in and added as articles. There will be a confirmation message to this effect detailing the number of items added.
Now if you go to the Articles tab on the left hand menu you should see the feed items there.
Importing old content before launch
It may be a requirement to populate a timeline with pre-existing content before launch. If so we'll need to a way to access older content in the RSS feed. A common way is pagination on the RSS feed (eg. /news.rss?page=5).
There shouldn't be more than about 1000 items per page and we'll need to agree how far back to go before launch, as currently it is a semi-manual process to change the feeds to go back in time.