View example.html
<span id="metaradio-now-title"></span> | |
<span id="metaradio-now-artist"></span> | |
<span id="metaradio-now-artwork"></span> | |
<script> | |
// Setup our HTTP request | |
var xhr_metaradio_now = new XMLHttpRequest(); | |
// Setup our listener to process completed requests | |
xhr_metaradio_now.onload = function () { |
View MetaRadio-Myriad-Template.xml
<?xml version="1.0"?> | |
<MetaRadioNow> | |
<Title><OCP_NOW_ITEMTITLE></Title> | |
<Artist><OCP_NOW_ARTISTNAMES></Artist> | |
<Duration><OCP_NOW_DURATIONSECS></Duration> | |
<StartTimestamp><OCP_SPECIAL_NOW_yyyy-mm-dd hh:nn:ss></StartTimestamp> | |
<Type><OCP_NOW_ITEMTYPEDESCRIPTION_1></Type> | |
<PlayoutId><OCP_NOW_ITEMNUMBER></PlayoutId> | |
</MetaRadioNow> |
View template.xml
<?xml version="1.0"?> | |
<MetaRadioNow> | |
<Type><![CDATA[SONG]]></Type> | |
<StartTimestamp><![CDATA[YYYY-MM-DD HH:MM:SS]]></StartTimestamp> | |
<Duration>240</Duration> | |
<Title><![CDATA[Song Title]]></Title> | |
<Artist><![CDATA[Artist Name]]></Artist> | |
<Album><![CDATA[Album Name]]></Album> | |
<PlayoutId><![CDATA[Unique ID / Filename]]></PlayoutId> | |
<ExternalId><![CDATA[Scheduling system ID - optional]]></ExternalId> |
View facebook-live-video-scraper.txt
This script allows you to scrape a Facebook page for live videos, and generate a iframe embed code for your website. It uses Selenium Firefox web driver. You may get banned if you run this too often - this is yet to be seen. | |
The file `livestream-data.json` will be updated with extra fields if/when a live video is found. |
View blockeditor_enableperpage.php
<?php | |
// Disable the Block Editor on all pages, except specific pages | |
add_filter('use_block_editor_for_post', '__return_false', 5); | |
add_filter('use_block_editor_for_post', function($can_edit, $post) { | |
// Conditionally allow the block editor per-page | |
if (empty($post->ID)) return $can_edit; | |
if (get_post_meta($post->ID, 'use_block_editor', true) == true) { |
View MetaRadioTemplate.xml
<?xml version="1.0"?> | |
<MetaNow> | |
<Type><![CDATA[%code0%]]></Type> | |
<StartTimestamp><![CDATA[%time0%]]></StartTimestamp> | |
<Duration><![CDATA[%duration0%]]></Duration> | |
<Title><![CDATA[%title0%]]></Title> | |
<Artist><![CDATA[%artist0%]]></Artist> | |
<Album><![CDATA[%album0%]]></Album> | |
<Filename><![CDATA[%file0%]]></Filename> | |
</MetaNow> |
View MetaRadioFile.xml
<?xml version="1.0"?> | |
<MetaNow> | |
<Type><![CDATA[<!--BSICATEGORY-->]]></Type> | |
<StartTimestamp><![CDATA[<!--BSIDATE--> <!--BSITIME-->]]></StartTimestamp> | |
<Duration><![CDATA[<!--BSILENGTH-->]]></Duration> | |
<Title><![CDATA[<!--BSITITLE-->]]></Title> | |
<Artist><![CDATA[<!--BSIARTIST-->]]></Artist> | |
<Album><![CDATA[<!--BSIALBUM-->]]></Album> | |
<Filename><![CDATA[<!--BSICURRENTFILE-->]]></Filename> | |
</MetaNow> |
View silence_gpio.py
# Requires https://github.com/anthonyeden/Livewire-Routing-Protocol-Client | |
import time | |
from LWRPClient import LWRPClient | |
# Connect to audio node | |
LWRP_Audio = LWRPClient("192.168.1.5", 93) | |
LWRP_Audio.login() | |
# Connect to GPIO node | |
LWRP_Logic = LWRPClient("192.168.1.5", 93) |
View countdown_5mins.txt
st = 300; | |
t = st - time; | |
c = timeToTimecode(t); | |
c = c.substring(4,8) | |
c |
View realtime.py
from apiclient.discovery import build | |
from oauth2client.service_account import ServiceAccountCredentials | |
import httplib2 | |
VIEW_ID = 'ga:123456789' | |
def get_service(api_name, api_version, scope, key_file_location, | |
service_account_email): | |
"""Get a service that communicates to a Google API. |
NewerOlder