1
|
|
|
<?php |
2
|
|
|
namespace Aoe\Asdis\Backend\Utility; |
3
|
|
|
|
4
|
|
|
/*************************************************************** |
5
|
|
|
* Copyright notice |
6
|
|
|
* |
7
|
|
|
* (c) 2020 AOE GmbH <[email protected]> |
8
|
|
|
* |
9
|
|
|
* All rights reserved |
10
|
|
|
* |
11
|
|
|
* This script is part of the TYPO3 project. The TYPO3 project is |
12
|
|
|
* free software; you can redistribute it and/or modify |
13
|
|
|
* it under the terms of the GNU General Public License as published by |
14
|
|
|
* the Free Software Foundation; either version 3 of the License, or |
15
|
|
|
* (at your option) any later version. |
16
|
|
|
* |
17
|
|
|
* The GNU General Public License can be found at |
18
|
|
|
* http://www.gnu.org/copyleft/gpl.html. |
19
|
|
|
* |
20
|
|
|
* This script is distributed in the hope that it will be useful, |
21
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
22
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23
|
|
|
* GNU General Public License for more details. |
24
|
|
|
* |
25
|
|
|
* This copyright notice MUST APPEAR in all copies of the script! |
26
|
|
|
***************************************************************/ |
27
|
|
|
|
28
|
|
|
class ScraperUtility |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* Register Scraper |
32
|
|
|
* |
33
|
|
|
* @param $extensionPath string |
34
|
|
|
* |
35
|
|
|
* @return void |
36
|
|
|
*/ |
37
|
|
|
public static function registerScrapers($extensionPath) |
38
|
|
|
{ |
39
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
40
|
|
|
'key' => 'cssUrl', |
41
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Css\Url', |
42
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Css/Url.php' |
43
|
|
|
]; |
44
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
45
|
|
|
'key' => 'htmlCssFile', |
46
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\CssFile', |
47
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/CssFile.php' |
48
|
|
|
]; |
49
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
50
|
|
|
'key' => 'htmlAppleTouchIcon', |
51
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\AppleTouchIcon', |
52
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/AppleTouchIcon.php' |
53
|
|
|
]; |
54
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
55
|
|
|
'key' => 'htmlCssAttribute', |
56
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\CssAttribute', |
57
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/CssAttribute.php' |
58
|
|
|
]; |
59
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
60
|
|
|
'key' => 'htmlCssInline', |
61
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\CssInline', |
62
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/CssInline.php' |
63
|
|
|
]; |
64
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
65
|
|
|
'key' => 'htmlEmbed', |
66
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\Embed', |
67
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/Embed.php' |
68
|
|
|
]; |
69
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
70
|
|
|
'key' => 'htmlFavicon', |
71
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\Favicon', |
72
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/Favicon.php' |
73
|
|
|
]; |
74
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
75
|
|
|
'key' => 'htmlImage', |
76
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\Image', |
77
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/Image.php' |
78
|
|
|
]; |
79
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
80
|
|
|
'key' => 'htmlInputImage', |
81
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\InputImage', |
82
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/InputImage.php' |
83
|
|
|
]; |
84
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
85
|
|
|
'key' => 'htmlOpenGraphImage', |
86
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\OpenGraphImage', |
87
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/OpenGraphImage.php' |
88
|
|
|
]; |
89
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
90
|
|
|
'key' => 'htmlScript', |
91
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\Script', |
92
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/Script.php' |
93
|
|
|
]; |
94
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
95
|
|
|
'key' => 'htmlCss3Image', |
96
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\Css3Image', |
97
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/Css3Image.php' |
98
|
|
|
]; |
99
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
100
|
|
|
'key' => 'htmlMetaMsApplication', |
101
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\MetaMsApplication', |
102
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/MetaMsApplication.php' |
103
|
|
|
]; |
104
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
105
|
|
|
'key' => 'htmlDataSrc', |
106
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\DataSrc', |
107
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/DataSrc.php' |
108
|
|
|
]; |
109
|
|
|
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['asdis']['scrapers'][] = [ |
110
|
|
|
'key' => 'htmlSrcset', |
111
|
|
|
'class' => 'Aoe\Asdis\Content\Scraper\Html\Srcset', |
112
|
|
|
'file' => $extensionPath . 'Classes/Content/Scraper/Html/Srcset.php' |
113
|
|
|
]; |
114
|
|
|
} |
115
|
|
|
} |