Skip to content

Commit

Permalink
feat(embed): LibCal playing - without pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
dblanken-yale committed Oct 22, 2024
1 parent ea71043 commit 5f663b7
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Drupal\ys_embed\Plugin\EmbedSource;

use Drupal\ys_embed\Plugin\EmbedSourceBase;
use Drupal\ys_embed\Plugin\EmbedSourceInterface;

/**
* Instagram post embed source.
*
* @EmbedSource(
* id = "libcal",
* label = @Translation("LibCal"),
* description = @Translation("LibCal embed source."),
* thumbnail = "",
* active = TRUE,
* )
*/
class LibCal extends EmbedSourceBase implements EmbedSourceInterface {

/**
* {@inheritdoc}
*/
protected static $pattern = '/(?<embed_code>\<div id="([^"]+)"\>\<\/div\>\<script src="https:\/\/schedule\.yale\.edu\/.*<\/script>)/';

/**
* {@inheritdoc}
*/
protected static $template = '{{ embed_code|raw }}';

/**
* {@inheritdoc}
*/
protected static $instructions = 'Find the embed code for an LibCal listing';

/**
* {@inheritdoc}
*/
protected static $example = '<div id="api_hours_today_iid457_lid4211"></div><script src="https://schedule.yale.edu/api_hours_today.php?iid=457&lid=4211&format=js&systemTime=0&context=object"> </script>';

}

0 comments on commit 5f663b7

Please sign in to comment.