Newsagent/Syndicate
| Newsagent | |
| |
| Author | Chris Page |
|---|---|
| Contact | Support |
| Repository | github |
| Issue tracker | github |
| OS | Neutral (web based) Will not work with IE8 or older |
| URL | Newsagent |
| Navigation | |
| |
As stated in the Feeds and Visibility documentation, all normal articles created in Newsagent must go into one or more feeds with at least one visibility level set. Feeds may then be requested by any client - website, feed reader or aggregator, and so on - that is interested in the articles, and each client may specify which level of article they are interested in seeing in the feed.
Feeds are exposed by the system in two formats:
- a 'HTML fragment' format suitable for directly embedding in pages, with css classes set on most elements to allow for styling to match the page the content is embedded in. This format is not supported for general use.
- RSS 2.0 formatted feeds compatible with most feed readers and aggregator. This is the recommended format for fetching feeds from the system.
Available feeds
The list of feeds available in the Newsagent system is given on the Feeds page. The Feeds page is the default newsagent page, and can always be accessed by clicking on the "Newsagent front page" icon at the top left of the page.
The Feed List page describes the features available on the Feed List page.
Feed options
If you would prefer to hand-craft the URL, the RSS generator script supports a number of options that allow you to control the articles included in the feed. The most important option is the feed option:
feed=<comma separated list of feeds>- The
feedoption allows you to specify which Newsagent feed or feeds you are interested in fetching articles from. This can either be a single Newsagent feed name, as shown in the table above, or you can request articles in multiple Newsagent feeds by separating the names with commas, eg:feed=pgt,pgr,ugtwill give you the articles published in the Study - PGT, Study - PGR, or Study - UGT Newsagent feeds. If you do not specify a feed at all, the system will give you articles published in all Newsagent feeds.
Please note that the order of feeds specified via this option is important when no viewer argument has been specified. Please see the Multiple Feeds documentation for more information. |
If you just ask for a Newsagent feed, you will get all published articles in that feed regardless of the visibility levels the author set on it. If you are only interested in a subset of articles with specific visibility levels, you should include the level option in the query:
level=<comma separated list of visibility levels>- The
leveloption allows you to select only articles that have been set to be published at the specified level(s). This can either be a single level, eg:level=homeor it can be a comma separated listlevels=home,leader. Valid levels are currentlyhome(Important (School Home Page)),leader(Medium (Section Leader Page)), andgroup(General (Group or Internal pages)). Omitting this option is equivalent tolevels=home,leader,group(ie: select all levels).https://newsagent.cs.manchester.ac.uk/rss?feed=pgt,pgr&level=leader,groupwill produce a feed containing articles published in the PGT or PGR feeds at the Medium or General levels.
A number of additional arguments are supported by the RSS generator script. These are:
id=<article id>orarticleid=<article id>- Allows the selection of a specific article in the system by its internal id. In general, if you include the
idorarticleidparameter in the query string, you will want to avoid including any other parameters to ensure that the article you are trying to select is not filtered out by other parameters.
fulltext=<mode>- Specifying this argument turns on the inclusion of the full article text in each returned item[1] The full text appears in a
<newsagent:fulltext>element in the RSS item unless thedescargument below is specified. Supported modes are:enabled: the full article HTML is included in each item.markdown: the full article text is converted to markdown text as much as possible.plain: the full article HTML is included, but all html stripped from the text.embedimg: the full article HTML is templated to include the article image if one has been set for the article.
desc=fulltext- This argument changes the way in which the RSS generator produces the
<decription>element in each item: normally it will use the article summary in the RSS<decription>element, but when this argument is specified the full article text is used instead. When specified, the<decription>element iwll contain the full article text as processed according to the current setting of thefulltextargument: if the feed is requested using the argumentsdesc=fulltext&fulltext=markdownthen the<decription>will contain the full article text with markdown formatting, similarly if it requested usingdesc=fulltext&fulltext=markdownthen the<decription>will contain the full article html with the article image embedded if there is one. Note that, ifdesc=fulltextis specified, but nofulltexthas been specified, thefulltextwill default toembedimg.
viewer=<name>- Specify a article viewer to use rather than the default calculated one. If this is set to
viewer=internalthe URL of a Newsagent internal article viewer will be included for each article in a generated feed. Otherwise the name specified can either be the name of a Newsagent feed, in which case all the articles in the generated feed will use the default viewer URL associated with that Newsagent feed, or it can be the name of a viewer URL. Note that directly specifying a URL is not supported: this argument requires a feed or viewer name, not a URL.
count=<number>- Lets you control how many items are included in the feed. The default is 10, there is a 'hard' maximum of 100 enforced by the system.
offset=<number>- Lets you change where the feed starts from. Normally the feed starts with the newest item first, and then older items after it up to the count. With this you can tell it to skip items, so if you do
offset=5, the first 5 newest items are skipped.
maxage=<number><d|m|y>- Controls the maximum age of the articles included in the feed. If this is specified, only articles less than the specified age will be included. The number specified is, by default, the age in days but you can append
moryto indicate that the number is a number of months or years, eg:maxage=6mwill mean that the feed will include articles that are up to 6 months old,maxage=2ywill include articles up to two years old. The default for this is1y, ie: articles up to one year old will be included in the feed.
RSS elements
When requesting RSS feeds from Newsagent, each <item> in the feed will contain the standard RSS elements
titlecontains the Subject set by the user, or the publication date if a subject was not set.linkcontains a link to an article viewer for the item.descriptioncontains the article summary, unlessdesc=fulltexthas been set, in which case it contains the full article text.pubDatecontains the publication date as a RFC 822 date-time value.guidis a globally unique id for the item.authorcontains the email address and name of the article author.
A number of custom elements will appear with each item, contained within a newsagent namespace:
newsagent:gravatarcontains the URL of the author's gravatarnewsagent:feedswill contain one or morenewsagent:feedelements, one for each Newsagent feed the article was posted in. Eachnewsagent:feedelement has anameattribute that stores the short name of the Newsagent feed, while the element contains the full Newsagent feed name.newsagent:fulltextonly appears when thefulltextargument was been specified when generating the feed, anddesc=fulltextwas not been set. It contains the full text of the article, and the format the text is in depends on the value set for thefulltextargument.newsagent:stickyappears in the item when the article has been set as "Sticky". It has a singleepochattribute containing the unix timestamp of the time and date the article will be sticky until. The element contains the same information as a human-readable RFC 822 date-time value.newsagent:imagesappears in the item when the article has one or more images associated with it. It has one or morenewsagent:imagechildren containing information about the images.newsagent:imageeach image associated with an article has anewsagent:imageelement associated with it in the RSS feed. It contains three attributes: thesrcattribute gives the URL of the image, thealtattribute contains alternative text for the image, andtypecontains the type of image; currently this may beleadfor the Lead Image,articlefor the Article Image, andthumbfor the article image thumbnail.
| |||||||||||||||||
- ↑ This argument is ignored by the HTML feed - the full article text is always included when the `full` HTML feed is used, and it is never included for `compact` or `feed`.
