Skip to content

SubscriptionServices

bgreenwood edited this page Jul 4, 2012 · 4 revisions

In Release 8, ANDS introduced subscription services for various parts of the Research Data Portal (RDA). The feed formats supported are RSS and ATOM (chosen due to their popularity and support in feed readers). Feeds are currently only configured for collections in RDA (although feeds can be manually customised to serve additional purposes - see Customising a Feed).

Feeds can be customised by tailoring a search using the Search / Advanced Search functions on RDA and then selecting the "Subscribe to this web feed" link on the bottom of the collections search results tab. Feeds can also be customised using the Browser (which will narrow the entries by subject type).

In essence, the Subscription Services are simply a wrapper on the SOLR search functionality. The feeds are generated by the /rda/.../controllers/search.php controller and call methods in the /rda/.../models/rss_channel.php model. As you might expect, the XML display of RSS and ATOM feeds is generated in /rda/.../views/search/rss.php and atom.php respectively.

Customising a Feed

RSS feeds are customised according to GET parameters passed in the URL. An example RSS feed (getting all collections added to the registry):

/search/rss/?q=*:*&classFilter=collection&typeFilter=All&groupFilter=All&subjectFilter=All&licenceFilter=All&subscriptionType=rss

To customise the search parameters, any valid SOLR query can be input into the q parameter. The filter parameters provide the ability to drill down and filter search results based on the same logic as the Search feature in RDA.

The subjectFilter parameter has some extra functionality:

  • Subject Filter can only reference terms from a supported Vocabulary (keywords not valid, use the q param
  • Subject Filter can either be a term label (such as "LAW") or a Term URI (such as http://purl.org/au-research/...)
  • Subject Filter can be customised to include all terms "lower" than the selected term in the hierarchy using the tilde character. i.e.
// Includes all records EXACTLY matching MATHEMATICAL SCIENCES
subjectFilter=http://purl.org/au-research/vocabulary/anzsrc-for/2008/01
// Includes all exact matches and matches lower in the vocabulary tree (such as Applied Mathematics)
subjectFilter=~http://purl.org/au-research/vocabulary/anzsrc-for/2008/01

Digests

When new records are added to the registry, any users which subscribe to feeds which that record would be part of will expect a new item in the feed to inform them of its existence. However, when a datasource harvests multiple records, this would cause the feed to be "flooded" by items. To address this, by default the feed will be in "digest" mode. This means that multiple records from the same contributor will be grouped together in a single "digest entry" which says "(x) new records have been added by (y)". Contributors are currently identified by the registryObject group attribute and the digest period is 1 day. To prevent this behaviour add the parameter digest=false to the feed URL.

Twitter Feed

A special feed has been created specifically for users who may wish to "tweet" when new records are added to the registry with ANZSRC-FOR codes.

  • /search/rss_twitter/ provides a customised feed which contains the equivalent of digest entries, but based on subject grouping and aggregated over a period of 1 week.

  • This feed is generated using a SOLR query constraining registry_date_modified to a 7 day window and facetting by broader_subject (this means that if a record is added to ANZSRC-FOR code 010201, there will be a minimum three entries, one for 01, 0102 and 010201).

  • The "tweet" functionality is not provided by this feed. Users should make use of a RSS-to-Twitter application (such as Hootsuite) or investigate the task manager-powered alternative in /orca/maintenance/_tasks/make_tweet.php and /orca/maintenance/_tasks/weekly_twitter_digest.php.

  • The weekly_twitter_digest task will read from the RSS feed and then queue a number of MAKE_TWEET tasks at three minute intervals to prevent being blocked by Twitter for spam.

  • The make_tweet task must be configured to use a Twitter Username, API Key and other configuration variables in order to link the task to the correct Twitter account. To do this, you must create an "App" from the Twitter Dev site and then add it to your Twitter Account. At this point, Twitter will provide the 4 necessary keys/hashes needed to authenticate. Note that whilst there are several tutorials indicating other approaches, "simple authentication" was blocked by Twitter in 2010, so you are forced to use OAuth.