1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Implementation of hook_feeds_importer_default(). |
---|
5 | */ |
---|
6 | function feeds_news_feeds_importer_default() { |
---|
7 | $export = array(); |
---|
8 | $feeds_importer = new stdClass; |
---|
9 | $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */ |
---|
10 | $feeds_importer->api_version = 1; |
---|
11 | $feeds_importer->id = 'feed'; |
---|
12 | $feeds_importer->config = array( |
---|
13 | 'name' => 'Feed', |
---|
14 | 'description' => 'Import RSS or Atom feeds, create nodes from feed items.', |
---|
15 | 'fetcher' => array( |
---|
16 | 'plugin_key' => 'FeedsHTTPFetcher', |
---|
17 | 'config' => array( |
---|
18 | 'auto_detect_feeds' => FALSE, |
---|
19 | 'use_pubsubhubbub' => FALSE, |
---|
20 | 'designated_hub' => '', |
---|
21 | ), |
---|
22 | ), |
---|
23 | 'parser' => array( |
---|
24 | 'plugin_key' => 'FeedsSyndicationParser', |
---|
25 | 'config' => array(), |
---|
26 | ), |
---|
27 | 'processor' => array( |
---|
28 | 'plugin_key' => 'FeedsNodeProcessor', |
---|
29 | 'config' => array( |
---|
30 | 'content_type' => 'feed_item', |
---|
31 | 'update_existing' => 0, |
---|
32 | 'expire' => '-1', |
---|
33 | 'mappings' => array( |
---|
34 | '0' => array( |
---|
35 | 'source' => 'title', |
---|
36 | 'target' => 'title', |
---|
37 | 'unique' => FALSE, |
---|
38 | ), |
---|
39 | '1' => array( |
---|
40 | 'source' => 'description', |
---|
41 | 'target' => 'body', |
---|
42 | 'unique' => FALSE, |
---|
43 | ), |
---|
44 | '2' => array( |
---|
45 | 'source' => 'timestamp', |
---|
46 | 'target' => 'created', |
---|
47 | 'unique' => FALSE, |
---|
48 | ), |
---|
49 | '3' => array( |
---|
50 | 'source' => 'url', |
---|
51 | 'target' => 'url', |
---|
52 | 'unique' => TRUE, |
---|
53 | ), |
---|
54 | '4' => array( |
---|
55 | 'source' => 'guid', |
---|
56 | 'target' => 'guid', |
---|
57 | 'unique' => TRUE, |
---|
58 | ), |
---|
59 | ), |
---|
60 | 'input_format' => 0, |
---|
61 | 'author' => 0, |
---|
62 | ), |
---|
63 | ), |
---|
64 | 'content_type' => 'feed', |
---|
65 | 'update' => 0, |
---|
66 | 'import_period' => '1800', |
---|
67 | 'expire_period' => 3600, |
---|
68 | 'import_on_create' => 1, |
---|
69 | ); |
---|
70 | |
---|
71 | $export['feed'] = $feeds_importer; |
---|
72 | $feeds_importer = new stdClass; |
---|
73 | $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */ |
---|
74 | $feeds_importer->api_version = 1; |
---|
75 | $feeds_importer->id = 'opml'; |
---|
76 | $feeds_importer->config = array( |
---|
77 | 'name' => 'OPML import', |
---|
78 | 'description' => 'Import subscriptions from OPML files. Use together with "Feed" configuration.', |
---|
79 | 'fetcher' => array( |
---|
80 | 'plugin_key' => 'FeedsFileFetcher', |
---|
81 | 'config' => array( |
---|
82 | 'direct' => FALSE, |
---|
83 | ), |
---|
84 | ), |
---|
85 | 'parser' => array( |
---|
86 | 'plugin_key' => 'FeedsOPMLParser', |
---|
87 | 'config' => array(), |
---|
88 | ), |
---|
89 | 'processor' => array( |
---|
90 | 'plugin_key' => 'FeedsFeedNodeProcessor', |
---|
91 | 'config' => array( |
---|
92 | 'content_type' => 'feed', |
---|
93 | 'update_existing' => 0, |
---|
94 | 'mappings' => array( |
---|
95 | '0' => array( |
---|
96 | 'source' => 'title', |
---|
97 | 'target' => 'title', |
---|
98 | 'unique' => FALSE, |
---|
99 | ), |
---|
100 | '1' => array( |
---|
101 | 'source' => 'xmlurl', |
---|
102 | 'target' => 'source', |
---|
103 | 'unique' => 1, |
---|
104 | ), |
---|
105 | ), |
---|
106 | ), |
---|
107 | ), |
---|
108 | 'content_type' => '', |
---|
109 | 'update' => 0, |
---|
110 | 'import_period' => '-1', |
---|
111 | 'expire_period' => 3600, |
---|
112 | 'import_on_create' => 1, |
---|
113 | ); |
---|
114 | |
---|
115 | $export['opml'] = $feeds_importer; |
---|
116 | return $export; |
---|
117 | } |
---|