Skip to content
Snippets Groups Projects
Select Git revision
  • 7.x-1.2
  • 7.x-1.x default
  • master
  • 7.x-1.5
  • 7.x-1.4
  • 7.x-1.3
  • 7.x-1.1
  • 7.x-1.0
8 results

feeds_callback_fetcher

  • Clone with SSH
  • Clone with HTTPS
  • Feeds Callback Fetcher
    ======================
    
    When importing content with Feeds, people uses different URLs.
    Those are generated by Views (RSS, XML, JSON), some others by custom modules.
    
    The problem
    ===========
    It also happend that some of these URLs can be guessed by people and/or search engine.
    
    The questions
    =============
    How to disable the access to those URLs for the anonymous user and let cron access to them ?  
    
    The solution
    ============
    This module has been created for fixing this.
    I needed a way to retrieve informations from URLs, but I didn't want those to be guessable or available to anyone.
    
    How it works ?
    ==============
    This module calls a callback function to get it's content instead of calling an URL.
    
    Example of use in a hook_cron():
    ================================
    <?php
    function hook_cron() {
      //Get the importer
      $source = feeds_source('my_custom_job_importer');
    
      // Configure the callback
      $fetcher_config['callback'] = '_custom_get_jobs';
      $source->setConfigFor($source->importer->fetcher, $fetcher_config);
    
      // trigger the importation
      $source->save();
      }
    ?>
    
    Dependencies
    ============
     * Feeds: http://drupal.org/project/feeds
    
    About the author
    ================
     * Pol Dellaiera: pol.dellaiera@protonmail.com