-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparse.php
executable file
·156 lines (134 loc) · 5.82 KB
/
parse.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
function is_feed() {
return false;
}
function get_the_ID() {
return '1';
}
function parserWrapper($pad) {
$encodedData = str_replace(' ','+',$pad);
$shownotesString = str_replace("\n", " \n", "\n" . base64_decode($encodedData) . "\n");
$shownotesString = $pad;
$mode = 'shownot.es';
$shownotes_options['main_delimiter'] = '';
$shownotes_options['main_last_delimiter'] = '';
$osf_starttime = 0;
$fullmode = 'true';
$fullint = 2;
$tags = explode(' ', 'chapter section spoiler topic embed video audio image shopping glossary source app title quote link podcast news');
$data['tags'] = $tags;
$data['fullmode'] = $fullmode;
$data['amazon'] = 'shownot.es-21';
$data['thomann'] = '93439';
$data['tradedoubler'] = '16248286';
$shownotesArray = osf_parser($shownotesString, $data);
$return['podcast'] = osf_get_podcastname(@$shownotesArray['header']);
$return['episode'] = str_replace($return['podcast'], '', osf_get_episodenumber(@$shownotesArray['header']));
$return['shownoter'] = osf_get_persons('shownoter', @$shownotesArray['header']);
$return['podcaster'] = osf_get_persons('podcaster', @$shownotesArray['header']);
$return['episodetime'] = osf_get_episodetime(@$shownotesArray['header']);
$return['subject'] = osf_get_episodename(@$shownotesArray['header']);
$return['json'] = json_encode($shownotesArray['export']);
$return['chapter'] = osf_export_chapterlist($shownotesArray['export']);
$return['osf'] = osf_export_osf($shownotesArray['export']);
return $return;
}
function parserWrapperAPI($postdata) {
if (isset($postdata['amazon']) && $postdata['amazon'] != '') {
$amazon = $postdata['amazon'];
} else {
$amazon = 'shownot.es-21';
}
if (isset($postdata['thomann']) && $postdata['thomann'] != '') {
$thomann = $postdata['thomann'];
} else {
$thomann = '93439';
}
if (isset($postdata['tradedoubler']) && $postdata['tradedoubler'] != '') {
$tradedoubler = $postdata['tradedoubler'];
} else {
$tradedoubler = '16248286';
}
$fullmode = 'false';
$tags = $postdata['tags'];
if ($tags == '') {
$fullmode = 'true';
$fullint = 2;
$tags = explode(' ', 'chapter section spoiler topic embed video audio image shopping glossary source app title quote link podcast news');
} else {
$fullint = 1;
if (!is_array($tags)) {
$tags = explode(' ', $tags);
}
}
$data = array(
'amazon' => $amazon,
'thomann' => $thomann,
'tradedoubler' => $tradedoubler,
'fullmode' => $fullmode,
'tagsmode' => 'include',
'tags' => $tags
);
$encodedData = str_replace(' ','+',$postdata['pad']);
$shownotesString = str_replace("\n", " \n", "\n" . base64_decode($encodedData) . "\n");
$mode = $postdata['mainmode'];
if ($mode == 'block') {
$mode = 'block style';
}
if ($mode == 'list') {
$mode = 'list style';
}
if ($mode == 'osf') {
$mode = 'clean osf';
}
$shownotes_options['main_delimiter'] = '';
$shownotes_options['main_last_delimiter'] = '';
$osf_starttime = 0;
if ($mode == 'shownot.es') {
$fullmode = 'true';
$fullint = 2;
$tags = explode(' ', 'chapter section spoiler topic embed video audio image shopping glossary source app title quote link podcast news');
$data['tags'] = $tags;
$data['fullmode'] = $fullmode;
$data['amazon'] = 'shownot.es-21';
$data['thomann'] = '93439';
$data['tradedoubler'] = '16248286';
}
$shownotesArray = osf_parser($shownotesString, $data);
if ($mode == 'shownot.es') {
$fullmode = 'true';
$fullint = 2;
$tags = explode(' ', 'chapter section spoiler topic embed video audio image shopping glossary source app title quote link podcast news');
$data['tags'] = $tags;
$data['fullmode'] = $fullmode;
$data['amazon'] = 'shownot.es-21';
$data['thomann'] = '93439';
$data['tradedoubler'] = '16248286';
$export = '<div class="info"> <div class="thispodcast"> <div class="podcastimg"> <img src="" alt="Logo"> </div> <?php include "./../episodeselector.php"; insertselector(); ?> </div> <div class="episodeinfo"> <table> <tr> <td>Podcast</td><td><a href="#"></a></td> </tr> <tr> <td>Episode</td><td><a href="#"></a></td> </tr> <tr> <td>Sendung vom</td><td>'.date("j. M Y").'</td> </tr> <tr> <td>Podcaster</td><td>'.osf_get_persons('podcaster', $shownotesArray['header']).'</td> </tr> <tr> <td>Shownoter</td> <td>'.osf_get_persons('shownoter', $shownotesArray['header']).'</td> </tr> </table> </div> </div><br/><br/>'."\n\n";
$export .= osf_export_block($shownotesArray['export'], 2, 'block style');
} elseif (($mode == 'block style') || ($mode == 'button style')) {
$export = osf_export_block($shownotesArray['export'], $fullint, $mode);
} elseif ($mode == 'list style') {
$export = osf_export_list($shownotesArray['export'], $fullint, $mode);
} elseif ($mode == 'clean osf') {
$export = osf_export_osf($shownotesArray['export'], $fullint, $mode);
} elseif ($mode == 'glossary') {
$export = osf_export_glossary($shownotesArray['export'], $fullint);
} elseif (($mode == 'shownoter') || ($mode == 'podcaster')) {
if (isset($shownotesArray['header'])) {
if ($mode == 'shownoter') {
$export = osf_get_persons('shownoter', $shownotesArray['header']);
} elseif ($mode == 'podcaster') {
$export = osf_get_persons('podcaster', $shownotesArray['header']);
}
}
} elseif ($mode == 'JSON') {
$export = json_encode($shownotesArray['export']);
} elseif ($mode == 'Chapter') {
$export = osf_export_chapterlist($shownotesArray['export']);
} elseif ($mode == 'PSC') {
$export = osf_export_psc($shownotesArray['export']);
}
return $export;
}
?>