Difference between revisions of "Feeds Module"

From Stadm
Jump to navigationJump to search
Line 15: Line 15:
 
#To sync data from an rss feed
 
#To sync data from an rss feed
 
#To import or migrate data in the form of a CSV file
 
#To import or migrate data in the form of a CSV file
 +
  
 
=== Pre-configuration ===
 
=== Pre-configuration ===
Line 20: Line 21:
 
*To add an importer
 
*To add an importer
 
**Go to admin->modules->Feeds->Feeds Admin UI->Configure->Add Importer
 
**Go to admin->modules->Feeds->Feeds Admin UI->Configure->Add Importer
 +
**Enter name and description of the importer you are creating
 +
***On the configuration page of your importer:
 +
****Fetcher -- change import type (upload or url)
 +
*****In the settings subsection you can chose which filetypes should be allowed
 +
***You can select the parser to be used in the Parser field
 +
****In most cases you should use CSV because it is easier to match to database
 +
*****In the settings you can change the default delimiter -- a semicolon is often the most effective because it is usually not used in content
 +
***Select Node Processor
 +
****In settings, chose the content type for which you would like to add the imported nodes
 +
****In Node Processor Mapping, you can select which CSV fields should be put into each Event Field in Drupal
  
  
Line 25: Line 36:
 
**In the feeds configuration settings, there is an option to add more import functions
 
**In the feeds configuration settings, there is an option to add more import functions
 
**I created an import function specifically for events
 
**I created an import function specifically for events
**In Node Processor Mapping, you can select which CSV fields should be put into each Event Field in Drupal
+
 
**The content type can be chosen in Node Processor settings
 
**There is an option to upload file, or to retrieve it from a website
 
  
 
*For the www-dev eri site, I created a script, which is currently located at http://www-dev.eri.ucsb.edu/sites/all/themes/eriomega/build_csv.php
 
*For the www-dev eri site, I created a script, which is currently located at http://www-dev.eri.ucsb.edu/sites/all/themes/eriomega/build_csv.php

Revision as of 12:46, 10 August 2012

Feeds is a Drupal module for importing data from feeds or structured content files (ie. csv).

About

  • Import csv data as nodes of a specified content type
  • Module located at "import" page
    • Several built in Importers
    • You can add more importers in the module configuration page
  • Can import csv with three types of delimiters
  1. semicolon
  2. comma
  3. TAB

Use

  • Feeds can be used in two ways
  1. To sync data from an rss feed
  2. To import or migrate data in the form of a CSV file


Pre-configuration

  • Before importing your content, you should set up an importer unless you plan on using the Events Importer that imports fields title, date, url and pi as nodes with the content type Event.
  • To add an importer
    • Go to admin->modules->Feeds->Feeds Admin UI->Configure->Add Importer
    • Enter name and description of the importer you are creating
      • On the configuration page of your importer:
        • Fetcher -- change import type (upload or url)
          • In the settings subsection you can chose which filetypes should be allowed
      • You can select the parser to be used in the Parser field
        • In most cases you should use CSV because it is easier to match to database
          • In the settings you can change the default delimiter -- a semicolon is often the most effective because it is usually not used in content
      • Select Node Processor
        • In settings, chose the content type for which you would like to add the imported nodes
        • In Node Processor Mapping, you can select which CSV fields should be put into each Event Field in Drupal


  • How feeds works
    • In the feeds configuration settings, there is an option to add more import functions
    • I created an import function specifically for events


  • For the www-dev eri site, I created a script, which is currently located at http://www-dev.eri.ucsb.edu/sites/all/themes/eriomega/build_csv.php
    • To use, place an exported xml file containing data from the old events database into the same directory as the script
    • the script should initially load a form that will ask you for the name of the file -- select it in the drip down menu and press Submit.
    • a link will appear to download the converted file
    • You should check the file for obvious errors before you upload it
      • Check to make sure there aren't any semicolons that should not be used as a delimiter
      • Check to make sure there aren't any new lines wehre there shouldn't be.
  • Once you have converted to csv, on the new ERI site:
    • go to /import
    • select "Events Import"
    • leave all options as they are, and choose the converted file with the upload form
    • Click "Import"