Integrating Drupal with NewsCred Feeds

Update: If you are using Drupal version 8.x or above, please contact support@newscred.com or your NewsCred representative to learn more about our exclusive offering!

Integrating Drupal with NewsCred Feeds

Integrating feeds into a Drupal site will require the installation of a few different modules. Once those modules are installed, they will ingest the NewsCred XML feed to create new article nodes. The feed can be imported at scheduled intervals.

Required Modules

Feeds

https://www.drupal.org/project/feeds

Feeds is an import and aggregation framework for Drupal. Creates article nodes out of the XML data parsed from the feed.

Requirements: Drupal 7.x

CTools 1.x

http://drupal.org/project/ctools

Required for the feeds module. Once it’s imported and activated, no configuration is required.

Job Scheduler

http://drupal.org/project/job_scheduler

Required for the feeds module. Once it’s imported and activated, configure how often the feed is parsed.

Feeds extensible parsers

https://www.drupal.org/project/feeds_ex

Required to configure the XPath & HTML of the feed that is being ingested. This is where the magic happens in the integration.

Install and enable each of the required modules.

Once the modules have been activated, it’s time to begin configuring everything.

Navigate to http://<domain>/?q=admin/modules ​(or whichever directory the Drupal admin section is located in)

Select the FEEDS module and click C​onfigure.

 

Select +​Add Importer

Basic Settings
Fill out basic settings information, the important ones are selecting the C​ontent Type a​nd setting the I​mport Interval.

 

Fetcher



Parser

This is where all of the ingestion logic is contained. We’re using the XPath syntax to define the part of the XML that matches up with each of the components on the page. Going through the exercise to map these fields based on your site design and components will ensure all of the data passes correctly from the feed to the front end of your site. 

 

Once the Xpath parser configuration is complete and matches the above screenshot or the export provided, you’re ready to map the elements in the feed to your existing targets on the page.  

 

 

Cron Job to Update the Feed 

After the fields are matched and the feed is ingested, the final step is to create a cron job so that the feed can automatically be ingested at some interval. Here is the documentation for how to create a cron using the Rackspace hosting solution. If you are using a different solution, there are related articles on the right that cover the major providers.


https://www.drupal.org/node/565408

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk