We have moved to docs.pugpig.com! You can find this article here
Importing Feeds from Pugpig on Vimeo.
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
Pugpig supports RSS feeds for creating both posts and editions. Note that the order in which the feeds are processed should not matter.
For example, if you processed an edition RSS feed first, you would have empty editions until the posts are added (either manually or through the Post feed). Similarly, if you create posts through the post feed, these may not be in an edition until the edition is created manually or through the edition feed. More information on importing editions via RSS can be found in the Pugpig RSS Edition & Timeline feed spec.
To import articles, you will need a standard RSS feed. If you are using WordPress for your CMS, the standard WordPress feed at /feed/rss will work.
Important Note: If the guid of a post changes, then it will be seen as a new post, and create a duplicate.
Important Note: If the articles in the feed are changing, the <updated> timestamp must also update to reflect this. If this does not happen, then the article will not be reprocessed, so updates to the articles will not be seen.
Pugpig’s RSS syndication relies on the updated date to know if a new version of the article should be pulled into the CMS, and distributed to the apps. If an article changes but the updated date does not, then Pugpig will not pull in the article. Conversely, if the updated date does change, then Pugpig will pull the article again, and users that have already downloaded that article may download the new version of the article should they look at it again.
The updated date should change if and only if the contents if the <item> tag has changed. Simply reordering items in the feed does NOT need the date to change.
Another option is to include a hash (md5, for example) of the contents of the <item> tag (excluding the updated date) and set the <updated> date for each article to be the current time. On our side, the Pugpig CMS will check to see if the article's content hash has changed. If it hasn't, it will reject the update. If it has, it will pull through the new changes.
Example feed
<?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. Some of the available Pugpig mappings using FeedWordpress can be found below
Express fields
rss_title
rss_author
rss_image_url_author-headshot
rss_footer
rss_standfirst
rss_slug
rss_image_url_main-media-image
rss_image_url_pugpig_widgets_article_image_override
rss_image_url_table-of-contents-icon-or-tile-image
rss_main_caption (main image caption)
rss_main_credit (main image credit)
rss_free_sample
rss_main_video (Youtube or Brightcove url only)
rss_main_video_poster_url
rss_toc_image_url
rss_edition_tag
pugpig_page_rank
rss_author_byline
rss_main_image_id
rss_main_video_poster_id
rss_toc_image_id
rss_edition_cover_url
edition_key
edition_date
pugpig_edition_itunes_app_id
edition_draft
edition_paid
edition_order_by_type
sharing_link
Pugpig Sounds via RSS
If you have the Pugpig Sounds plugin enabled on your site, you can use the following field to map the value of an external audio link tag from your RSS feed to the Pugpig Sounds field.
Pugpig Sounds Express field:
rss_audio_url_rss_serial_(pugpigsounds)[0].(file)[0]
The value of this field should be a fully qualified URL, i.e https://www.pugpig.com/examples/mp3/Sound-1.mp3
Pugpig Bolt Audio Widget via RSS
If you're using FeedWordPress to create Audio widgets from an RSS feed, you can map the following fields
rss_audio_url_pugpig_widgets_audio_file
rss_image_url_pugpig_widgets_audio_image
pugpig_widgets_audio_external_source
or you can map to the external MP3 field
pugpig_widgets_audio_external_source
The value of this field should be a fully qualified URL, i.e https://www.pugpig.com/examples/mp3/Sound-1.mp3
1. 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):
Syndicated sites page empty:
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:
2. Mapping fields
If you move your mouse over the item several links will appear below the title, as seen in [Figure 5]. Click on the Posts tab.
Figure 6 - Subscribed feed options:
Scroll down till you see the tab in [Figure 6]:
Figure 7 - Custom post settings:
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. Express 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:
Figure 8 - Field mapping example:
3. 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 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. They will be ordered by date according to the feed, so will not necessarily all be in a clump together on the first page. On the POC site, they appeared for me at the bottom of the second:
Figure 9 - Article list:
Now if we look at an article we should see the main content in the body, the title, etc filled out for us.
Figure 10 - Article preview:
4. Main media
On some occasions we have an issue where some fields are not filled out on the first try. e.g.:
Figure 11 - Main media fields:
Since we mapped the image field we would expect to see the image here. Click update on the page as if you were editing it to refresh it. (update though do not refresh).
Figure 12 - Main media fields with publish options:
The main image will now show up, along with any other feed items that should have been filled out.
That’s it!
Note that you can only have one copy of a feed article in the system at any one time. If you set up a feed, test it, change something in the feed mapping then re import, you must delete imported articles first. This is done via the article management screen. Move them to the bin then EMPTY the bin as well.
Taxonomy Mapping
It is also possible to map taxonomy or tags from your feed onto your content in Express. This is done from the Categories panel in the syndication tab.
Edition Ordering
If you wish the order of pages to be automatic, use the <position> element to specify the position. These are sorted as integers.
Automating Edition Tags
<title>Example Post 1</title>
<link>http://www.pugpig.com/story1.html</link>
<issue>may2019</issue>
<position>57</position>
5. Inline Elements
If your feed is being imported into Pugpig Express, then it is good to use the markup and styles needed by Express for inline elements. Custom CSS will need to be created for unrecognised elements.
Simple elements should work if you follow the standard HTML spec, including:
- <strong>
- <em>
- <img> and <videos>
- <blockquote> with optional <cite>
- <figure> with optional <figcaption> and a <p> for the credit
For other more complex items such as box-outs, custom video players, third party scripts or social embeds, speak to the team here to get examples of the markup that will work best.
Advanced feed curation
Comments
0 comments
Please sign in to leave a comment.