Wednesday 20 March 2019

Aggregator Module Configuration Drupal 8

Drupal 8 having aggregator module in its core.
Aggregator module allows to collect information from external sources and then publish this information on our website. This information can include RSS, RDF, or Atom feeds.
For example, if you want to publish a list of headlines and article summaries from an external news site, Use aggregator module.

RSS
  • RSS stands for Rich Site Summary. It is used to monitor rapidly changing information in an organized and user-friendly way on the web.
  • This monitors news sites, blogs, Twitter or Facebook pages, financial information, daily deals, classified sites and government alerts.
  • By posting a "feed" on their page, web site owners allows RSS readers to search their site continuously look for fresh and new information.
RDF
  • RDF stands for Resource Description Framework which describe resources on the web.
  • RDF is a standard model for data interchange on the web and it facilitates data merging even if the underlying schemas are differ.
  • RDF is designed to be read and understood by computers but not for being displayed to people.
  • RDF is written in XML.
  • Examples: Describing properties for shopping items, such as price and availability, Describing time schedules for web events, Describing information about web pages (content, author, created and modified date), Describing content and rating for web pictures, Describing content for search engines, Describing electronic libraries
Atom
  • Atom is a simple way to read and write information on the web, allows you to easily keep track of more sites in less time, and to seamlessly share your words and ideas by publishing to the web.
  • The Atom format was developed as an alternative to RSS.

Enable aggregator core module. 
Once enabled, the module provides a new screens for us to manage external site feeds.
See configuration page listed under "Web Services" sections





After clicking on the "Aggregator" link, it will take us to Feed overview page where existing feeds are listed and can be add new ones.


Example: Set up headline feed from the BBC news website having RSS feed link: http://feeds.bbci.co.uk/news/rss.xml?edition=uk
Click on "Add feed" and fill details as shown in image. 

Save new feed and will get confirmation message of feed creation.
Feed is empty because the Aggregator module only gets triggered to check for new content on a cron run. 
Run cron with the help of command drush cron or visit the feeds overview page.
Locate the BBC news feed just setup.
Open up the menu in the rightmost OPERATIONS column and click on the Update items button:
You should then see that the number of items is set.

NOTE: Aggreagtor module try to update your feed every hour but cron is set to 3 hours by default. So if you really wants to update feed every hour, then set cron to run once per hour.
Aggregator module provides a dedicated block for each feed which is created. Now we will add the BBC news block to Sidebar First region. 

To do this Navigate to Structure > Block Layout

Go to sidebar first region and click on the place block button, Select BBC news block as shown in screenshot. 




Choose the feed from the list "Select the feed that should be displayed". In this case it is BBC News
Save the block.
Now This block will start to appear on sidebar_first.




There is another screen provided by the Aggregator module by navigating to Manage > Configuration > Web Services > Feed aggregator (admin/config/services/aggregator).

Click on the Settings tab to see the details:






Now see the above BBC News block view.

No comments:

Post a Comment