Create an install hook to pre-define a list of films to import.
Objectives and Prerequisites
You will need the following knowledge and skills. If you need a review, check out the Resources section at the bottom of this page.
- Create an install hook.
- Use variables within a module.
Tasks
Create an update hook for the Movie Import module that saves a list of movie names in a variable. The list can be hardcoded, or an API can be used to generate the list when the hook is run.
Summary
- Install hooks are used to define configuration settings and default data for a module.
Resources
- API Documentation: Function hook_update_N (api.drupal.org)
- Video (using hook_update_N): Adding a Table to the Database (Drupalize.Me)
- Yahoo YQL IMDB Query, which can be used to get a list of movies from IMDB in JSON. (yahooapis.com)