Projet

Général

Profil

Paste
Télécharger (3,3 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / feeds / feeds_news / feeds_news.feeds_importer_default.inc @ ed9a13f1

1
<?php
2

    
3
/**
4
 * @file
5
 * feeds_news.feeds_importer_default.inc
6
 */
7

    
8
/**
9
 * Implements hook_feeds_importer_default().
10
 */
11
function feeds_news_feeds_importer_default() {
12
  $export = array();
13

    
14
  $feeds_importer = new stdClass();
15
  $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
16
  $feeds_importer->api_version = 1;
17
  $feeds_importer->id = 'feed';
18
  $feeds_importer->config = array(
19
    'name' => 'Feed',
20
    'description' => 'Import RSS or Atom feeds, create nodes from feed items.',
21
    'fetcher' => array(
22
      'plugin_key' => 'FeedsHTTPFetcher',
23
      'config' => array(
24
        'auto_detect_feeds' => 1,
25
        'use_pubsubhubbub' => 0,
26
        'designated_hub' => '',
27
      ),
28
    ),
29
    'parser' => array(
30
      'plugin_key' => 'FeedsSyndicationParser',
31
      'config' => array(),
32
    ),
33
    'processor' => array(
34
      'plugin_key' => 'FeedsNodeProcessor',
35
      'config' => array(
36
        'bundle' => 'feed_item',
37
        'update_existing' => '0',
38
        'expire' => '-1',
39
        'mappings' => array(
40
          0 => array(
41
            'source' => 'title',
42
            'target' => 'title',
43
            'unique' => FALSE,
44
          ),
45
          1 => array(
46
            'source' => 'timestamp',
47
            'target' => 'created',
48
            'unique' => FALSE,
49
          ),
50
          2 => array(
51
            'source' => 'url',
52
            'target' => 'url',
53
            'unique' => 1,
54
          ),
55
          3 => array(
56
            'source' => 'guid',
57
            'target' => 'guid',
58
            'unique' => 1,
59
          ),
60
          4 => array(
61
            'source' => 'description',
62
            'target' => 'field_feed_item_description',
63
            'unique' => FALSE,
64
          ),
65
        ),
66
        'input_format' => 'filtered_html',
67
        'author' => 0,
68
      ),
69
    ),
70
    'content_type' => 'feed',
71
    'update' => 0,
72
    'import_period' => '1800',
73
    'expire_period' => 3600,
74
    'import_on_create' => 1,
75
    'process_in_background' => FALSE,
76
  );
77
  $export['feed'] = $feeds_importer;
78

    
79
  $feeds_importer = new stdClass();
80
  $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
81
  $feeds_importer->api_version = 1;
82
  $feeds_importer->id = 'opml';
83
  $feeds_importer->config = array(
84
    'name' => 'OPML import',
85
    'description' => 'Import subscriptions from OPML files. Use together with "Feed" configuration.',
86
    'fetcher' => array(
87
      'plugin_key' => 'FeedsFileFetcher',
88
      'config' => array(
89
        'direct' => FALSE,
90
      ),
91
    ),
92
    'parser' => array(
93
      'plugin_key' => 'FeedsOPMLParser',
94
      'config' => array(),
95
    ),
96
    'processor' => array(
97
      'plugin_key' => 'FeedsNodeProcessor',
98
      'config' => array(
99
        'bundle' => 'feed',
100
        'update_existing' => 0,
101
        'expire' => '-1',
102
        'mappings' => array(
103
          0 => array(
104
            'source' => 'title',
105
            'target' => 'title',
106
            'unique' => FALSE,
107
          ),
108
          1 => array(
109
            'source' => 'xmlurl',
110
            'target' => 'feeds_source',
111
            'unique' => 1,
112
          ),
113
        ),
114
      ),
115
    ),
116
    'content_type' => '',
117
    'update' => 0,
118
    'import_period' => '-1',
119
    'expire_period' => 3600,
120
    'import_on_create' => 1,
121
  );
122
  $export['opml'] = $feeds_importer;
123

    
124
  return $export;
125
}