PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 3.5.0
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v3.5.0
4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / vendor / wpdevelopers / embera / src / Embera / Provider / Meetup.php
embedpress / vendor / wpdevelopers / embera / src / Embera / Provider Last commit date
ActBlue.php 5 years ago Adways.php 5 years ago Altru.php 5 years ago AmCharts.php 5 years ago Animoto.php 5 years ago AnnieMusic.php 5 years ago Apester.php 5 years ago Archivos.php 5 years ago AudioClip.php 5 years ago Audioboom.php 5 years ago Audiomack.php 5 years ago Avocode.php 5 years ago Backtracks.php 5 years ago BeautifulAI.php 5 years ago BlackfireIO.php 5 years ago Blogcast.php 5 years ago Buttondown.php 5 years ago Byzart.php 5 years ago Ceros.php 5 years ago ChartBlocks.php 5 years ago Chirbit.php 5 years ago CircuitLab.php 5 years ago Clyp.php 5 years ago CocoCorp.php 5 years ago CodeHS.php 5 years ago CodePen.php 5 years ago CodeSandbox.php 5 years ago Codepoints.php 5 years ago Commaful.php 5 years ago Coub.php 5 years ago Cueup.php 5 years ago DailyMotion.php 5 years ago Datawrapper.php 5 years ago Deseretnews.php 5 years ago Deviantart.php 5 years ago Didacte.php 5 years ago Digiteka.php 5 years ago DocDroid.php 5 years ago DotSUB.php 5 years ago EduMedia.php 5 years ago Embedery.php 5 years ago Ethfiddle.php 5 years ago Eyrie.php 5 years ago FITE.php 5 years ago Facebook.php 4 years ago Fader.php 5 years ago FaithLifeTV.php 5 years ago Fitapp.php 5 years ago Flickr.php 5 years ago Flourish.php 5 years ago GeographCI.php 5 years ago GeographDE.php 5 years ago GeographUk.php 5 years ago GetShow.php 5 years ago GettyImages.php 5 years ago Gfycat.php 5 years ago Giphy.php 5 years ago GloriaTV.php 5 years ago Gyazo.php 5 years ago Hearthis.php 5 years ago HiHaHo.php 5 years ago Huffduffer.php 5 years ago IHeartRadio.php 5 years ago Infogram.php 5 years ago Infoveave.php 5 years ago Injurymap.php 5 years ago Inoreader.php 5 years ago Instagram.php 5 years ago Issuu.php 5 years ago Jovian.php 5 years ago KakaoTV.php 5 years ago Kickstarter.php 5 years ago Kidoju.php 5 years ago KirimEmail.php 5 years ago Kit.php 5 years ago Kmdr.php 5 years ago Knacki.php 5 years ago LearningApps.php 5 years ago LillePod.php 5 years ago Livestream.php 5 years ago Loom.php 5 years ago Ludus.php 5 years ago Lumiere.php 5 years ago Matterport.php 5 years ago MediaLab.php 5 years ago MedienArchivKuenste.php 5 years ago Meetup.php 3 years ago MermaidInk.php 5 years ago MessesInfo.php 5 years ago MicrosoftStream.php 5 years ago MixCloud.php 5 years ago ModeloIO.php 5 years ago MusicboxManiacs.php 5 years ago Namchey.php 5 years ago Nanoo.php 5 years ago NaturalAtlas.php 5 years ago Nfb.php 5 years ago NoPaste.php 5 years ago Omniscope.php 5 years ago OnSizzle.php 5 years ago OraTV.php 5 years ago Orbitvu.php 5 years ago Outplayed.php 5 years ago OverflowIO.php 5 years ago Oz.php 5 years ago Padlet.php 5 years ago Pastery.php 5 years ago Pinpoll.php 5 years ago Pixdor.php 5 years ago Playbuzz.php 5 years ago Podbean.php 5 years ago PolariShare.php 5 years ago Polldaddy.php 5 years ago Portfolium.php 5 years ago Posixion.php 5 years ago ProviderAdapter.php 5 years ago ProviderInterface.php 4 years ago RadioPublic.php 5 years ago Rcvis.php 5 years ago Reddit.php 5 years ago ReleaseWire.php 5 years ago Replit.php 5 years ago ReverbNation.php 5 years ago Roomshare.php 5 years ago RoosterTeeth.php 5 years ago Rumble.php 5 years ago RunKit.php 5 years ago Saooti.php 5 years ago SapoVideos.php 5 years ago ScreenNine.php 5 years ago Screencast.php 5 years ago ScribbleMaps.php 5 years ago Scribd.php 5 years ago SendToNews.php 5 years ago Shortnote.php 5 years ago Shoudio.php 5 years ago ShowTheWay.php 5 years ago Simplecast.php 5 years ago Sketchfab.php 5 years ago Slideshare.php 5 years ago SmashNotes.php 5 years ago Smugmug.php 5 years ago SocialExplorer.php 5 years ago SongLink.php 5 years ago SoundCloud.php 5 years ago SpeakerDeck.php 5 years ago Spotful.php 5 years ago Spotify.php 5 years ago Spreaker.php 5 years ago StandfordDigitalRepository.php 5 years ago Streamable.php 5 years ago Subscribi.php 5 years ago Sudomemo.php 5 years ago Sutori.php 5 years ago Sway.php 5 years ago Ted.php 5 years ago TheNewYorkTimes.php 5 years ago Tickcounter.php 5 years ago TikTok.php 5 years ago Toornament.php 5 years ago TourHero.php 5 years ago Tumblr.php 5 years ago Tuxx.php 5 years ago Tvcf.php 5 years ago TwentyThreeHq.php 5 years ago Twitter.php 5 years ago Typecast.php 5 years ago Typlog.php 5 years ago UniversitePantheonSorbonne.php 5 years ago UniversityCambridgeMap.php 5 years ago Uppy.php 5 years ago UstreamTV.php 5 years ago Ustudio.php 5 years ago Veer.php 5 years ago Verse.php 5 years ago Vidyard.php 5 years ago Vimeo.php 5 years ago Viously.php 5 years ago Vlipsy.php 5 years ago Vlive.php 5 years ago VoxSnap.php 5 years ago WaveVideo.php 5 years ago Wistia.php 5 years ago Wizer.php 5 years ago Wokwi.php 5 years ago WolframCloud.php 5 years ago Wordpress.php 5 years ago Wordwall.php 5 years ago Youtube.php 5 years ago Zeplin.php 5 years ago Zingsoft.php 5 years ago ZnipeTV.php 5 years ago Zoomable.php 5 years ago iFixit.php 5 years ago
Meetup.php
264 lines
1 <?php
2 /**
3 * Meetup.php
4 *
5 * @package Embera
6 * @author Michael Pratt <yo@michael-pratt.com>
7 * @link http://www.michael-pratt.com/
8 *
9 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 */
12
13 namespace Embera\Provider;
14
15 use Embera\Url;
16
17 /**
18 * Meetup Provider
19 * @link https://meetup.com
20 */
21 class Meetup extends ProviderAdapter implements ProviderInterface
22 {
23 /** inline {@inheritdoc} */
24 protected $shouldSendRequest = false;
25 /** inline {@inheritdoc} */
26 protected $endpoint = 'https://api.meetup.com/oembed?format=json';
27
28 /** inline {@inheritdoc} */
29 protected static $hosts = [
30 'meetup.com'
31 ];
32
33 /** inline {@inheritdoc} */
34 protected $httpsSupport = true;
35
36 /** inline {@inheritdoc} */
37 protected $responsiveSupport = true;
38
39 /** inline {@inheritdoc} */
40 public function validateUrl(Url $url)
41 {
42 return (bool) (
43 preg_match('~meetup\.com/(?:.+)~i', (string) $url) ||
44 preg_match('~meetu\.ps/(?:\w+)/?$~i', (string) $url)
45 );
46 }
47
48 /** inline {@inheritdoc} */
49 public function normalizeUrl(Url $url)
50 {
51 $url->convertToHttps();
52 $url->removeQueryString();
53
54 return $url;
55 }
56
57 public function getStaticResponse() {
58 $meetup_website = 'https://meetup.com';
59 $response = [];
60 $response['type'] = 'rich';
61 $response['provider_name'] = 'Meetup';
62 $response['provider_url'] = $meetup_website;
63 $response['url'] = $this->getUrl();
64 $hash = 'mu_'.md5( $this->getUrl());
65 $filename = wp_get_upload_dir()['basedir'] ."/embedpress/$hash.txt";
66 add_filter('safe_style_css', [$this, 'safe_style_css']);
67 $allowed_protocols = wp_allowed_protocols();
68 $allowed_protocols[] = 'data';
69
70 if (file_exists( $filename) ) {
71 $response['html'] = file_get_contents( $filename);
72 return $response;
73 }else{
74 $t = wp_remote_get( $this->getUrl() , ['timeout'=>10]);
75 if ( !is_wp_error( $t) ) {
76 if ( $meetup_page_content = wp_remote_retrieve_body( $t) ) {
77 $dom = str_get_html($meetup_page_content);
78 }
79 }
80 }
81
82
83 if ( empty( $dom) || !is_object( $dom) ) {
84 $response['html'] = $this->getUrl();
85 return $response;
86 }
87
88
89 // Event info
90 $header_dom = $dom->find('div[data-event-label="top"]', 0);
91 $body_dom = $dom->find('div[data-event-label="body"]', 0);
92 $event_location_info = $dom->find( 'div[data-event-label="info"] .sticky', 0);
93 if(empty($header_dom) || empty($body_dom) || empty($event_location_info)){
94 return [];
95 }
96 $dewqijm = $event_location_info->find('.dewqijm', 0)->find('span', 0);
97 $img = $dewqijm->find('noscript', 0)->innertext();
98 $dewqijm->removeChild($dewqijm->find('img', 1));
99 $dewqijm->find('noscript', 0)->remove();
100 $dewqijm->outertext = $dewqijm->makeup() . $dewqijm->innertext . $img . '</span>';
101
102
103 $date = $this->embedpress_get_markup_from_node( $header_dom->find( 'time', 0) );
104 $title = $this->embedpress_get_markup_from_node($header_dom->find('h1', 0));
105 $emrv9za = $body_dom->find('div.emrv9za', 0);
106 $picture = $emrv9za->find('picture[data-testid="event-description-image"]', 0);
107 $picture->find('img', 0)->remove();
108 $img = $picture->find('noscript', 0)->innertext();
109 $img = str_replace('/_next/image/', 'https://www.meetup.com/_next/image/', $img);
110 $picture->find('noscript', 0)->remove();
111 $span = $picture->find('div', 0)->find('span', 0);
112 $span->outertext = $span->makeup() . $span->innertext . $img . '</span>';
113
114 $content = $this->embedpress_get_markup_from_node( $emrv9za ) ;
115
116
117
118 $host_info = $header_dom->find('a[data-event-label="hosted-by"]', 0);
119 ob_start();
120 echo $host_info;
121 $host_info = ob_get_clean();
122
123
124 ob_start();
125 echo $event_location_info;
126 $event_location_info = ob_get_clean();
127
128 ob_start();
129 ?>
130 <article class="embedpress-event">
131 <header class="ep-event-header">
132 <!--Date-->
133 <span class="ep-event--date"><?php echo esc_html( $date); ?></span>
134 <!--Event Title -->
135 <a class="ep-event-link" href="<?php echo esc_url( $this->getUrl()); ?>" target="_blank">
136 <h1 class="ep-event--title"><?php echo esc_html( $title); ?></h1>
137 </a>
138 <!-- Event Host -->
139 <div class="ep-event--host">
140 <?php echo wp_kses_post( $host_info );?>
141 </div>
142 </header>
143
144 <section class="ep-event-content">
145 <div class="ep-event--description">
146 <?php echo wp_kses_post( $content );?>
147 </div>
148 </section>
149
150 <aside>
151 <?php echo wp_kses( $event_location_info, 'post', $allowed_protocols); ?>
152 </aside>
153
154 </article>
155
156 <style>
157 .embedpress-event a,
158 .embedpress-event button {
159 text-decoration: none !important;
160
161 }
162 .ep-event-header {
163 text-align: left;
164 }
165 .ep-event-header .ep-event--host .flex {
166 display: flex;
167 align-items: center;
168 gap: 12px;
169 }
170
171 .ep-event-header .ep-event--host .flex div {
172 line-height: 1.3 !important;
173 }
174 .ep-event-header .ep-event--host img {
175 border-radius: 50%;
176 }
177 .ep-event-content {
178 text-align: left;
179 }
180
181 .ep-event-content h2 {
182 font-size: 22px;
183 margin: 10px 0;
184 }
185 .embedpress-event aside .sticky {
186 display: flex;
187 gap: 30px;
188 text-align: left;
189 line-height: 1.3 !important;
190 }
191 .embedpress-event aside .sticky .hidden {
192 display: block;
193 }
194 .embedpress-event aside .sticky .hidden,
195 .embedpress-event aside .sticky .hidden + div {
196 flex: 0 0 calc(50% - 15px);
197 }
198 .embedpress-event aside .sticky .hidden .flex {
199 gap: 8px;
200 }
201 .embedpress-event aside .sticky .hidden .flex button {
202 background: transparent;
203 padding: 3px;
204 border: 0;
205 outline: none;
206 box-shadow: none;
207 }
208 /* .ep-event-header a {
209 font-size: 0;
210 } */
211 /* .ep-event-header a div {
212 font-size: 0;
213 }
214 .ep-event-header > a > div > div {
215 border-raidus: 50%;
216 overflow: hidden;
217 } */
218 </style>
219
220 <?php
221 $event_output = ob_get_clean();
222 file_put_contents( $filename, $event_output);
223 embedpress_schedule_cache_cleanup();
224 $response['html'] = $event_output;
225 remove_filter('safe_style_css', [$this, 'safe_style_css']);
226 return $response;
227 }
228
229 public function safe_style_css($styles){
230 $styles[] = 'position';
231 $styles[] = 'display';
232 $styles[] = 'opacity';
233 $styles[] = 'box-sizing';
234 $styles[] = 'left';
235 $styles[] = 'bottom';
236 $styles[] = 'right';
237 $styles[] = 'top';
238 return $styles;
239 }
240
241 /**
242 * It checks for data in the node before returning.
243 *
244 * @param \simple_html_dom_node $node
245 * @param string $method
246 * @param string $attr_name
247 *
248 * @return string it returns data from the node if found or empty strings otherwise.
249 */
250 public function embedpress_get_markup_from_node( $node, $method='innertext', $attr_name=''){
251 if ( !empty( $node) && is_object( $node) ) {
252 if ( !empty( $attr_name) ) {
253 return $node->getAttribute( $attr_name );
254 }
255 if ( !empty( $method) && method_exists( $node, $method) ) {
256 return $node->{$method}();
257 }
258 return '';
259 }
260 return '';
261 }
262
263 }
264