Skip to content

Instantly share code, notes, and snippets.

View anthonyeden's full-sized avatar
💭
Working on changing the world.

Anthony Eden anthonyeden

💭
Working on changing the world.
View GitHub Profile
@anthonyeden
anthonyeden / gist:d3b395e0406f489b05fe
Created June 28, 2015 08:13
2wcom Example RDS Commands
DURATION=120\n
STRING1=Now: \n
STRING2= by \n
FORMAT_RT=STRING1+TITLE+STRING2+ARTIST\n
AUTO_RT=Y\n
AUTO_RTPLUS=Y\n
RT_DELAY=3\n
TITLE=This is Living\n
ARTIST=Young and Free\n
@anthonyeden
anthonyeden / gist:0a4becbde55bf565803f
Created June 28, 2015 08:14
2wcom RDS Commands via Python
import serial
def updateRDS(comPort, title, artist, duration):
serialConnection = serial.Serial(comPort)
serialConnection.write("DURATION=" + str(int(duration)) + "\n")
serialConnection.write("STRING1=Now: \n")
serialConnection.write("STRING2= by \n")
serialConnection.write("FORMAT_RT=STRING1+TITLE+STRING2+ARTIST\n")
serialConnection.write("AUTO_RT=Y\n")
@anthonyeden
anthonyeden / gist:5619384
Created May 21, 2013 12:16
RDS Decoder Psudocode (See: http://mediarealm.com.au/articles/2013/05/parsing-rds-group-data-with-pira-p175-and-python/ for more details and explanation of what's happening)
while True:
line = ser.readline()
if (line.find("-") < 0) and (line.__len__() > 16):
hexdata = line.rstrip()
#We need five bits to detect the group type, so turn it into binary:
binaryLine = bin(int(hexdata, 16))[2:].zfill(64)
#RadioText-A:
if binaryLine[16:21] == "00100":
@anthonyeden
anthonyeden / data.php
Created May 24, 2016 06:47
Tally Puller WP Plugin Sample
<?php
// Sample Appeal Tally - Wordpress Plugin
// Provided by Anthony Eden
// Finds and returns various appeal figures for embedding on our pages
// This should be loaded via AJAX, as we don't want a blocking script on our page
//All returned data will be in JSON format
header('Content-type: text/json');
@anthonyeden
anthonyeden / DreamObjectsUpload.sh
Created September 20, 2016 10:16
DreamObjects Sample Upload Script (Bash)
#!/bin/bash
function uploadDreamObjects {
# Uploads a single file to the DreamObjects S3-style API
# Sample code provided by http://mediarealm.com.au/
# Based on https://gist.github.com/chrismdp/6c6b6c825b07f680e710
# Also https://raw.githubusercontent.com/fredericofs/s3.bash/master/simple_version_working
# And http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
@anthonyeden
anthonyeden / TrelloTimeTracker.php
Created April 17, 2017 07:11
Trello Time Tracker
<?php
// Trello Time Tracker
// (C) 2017 Anthony Eden
// http://mediarealm.com.au/
// This script takes an JSON export from a Trello board (saved as data.json) and shows you a timesheet
// It uses Custom Fields in Trello to read the hours spent working on each card, then displays it as a table
// Simple, yet very handy.
@anthonyeden
anthonyeden / Zetta-LogLoadEmail.py
Created October 21, 2017 05:01
Zetta: Email Alerts for Flat-File Log Imports
"""
Zetta Log Import Emailer
This script will email you whenever a new log is imported into Zetta
Written by Anthony Eden (https://mediarealm.com.au/)
"""
# You need to download this module: https://pypi.python.org/pypi/pypyodbc
# Email config options
@anthonyeden
anthonyeden / MetaRadioSimian.xml
Created March 25, 2018 07:41
MetaRadio Simian Pro XML Template
<?xml version="1.0"?>
<MetaNow>
<Type><![CDATA[%CATEGORY%]]></Type>
<StartTimestamp><![CDATA[%CURDATE% %CURTIME%]]></StartTimestamp>
<Duration>%LENGTHSECONDS%</Duration>
<Title><![CDATA[%TITLE%]]></Title>
<Artist><![CDATA[%ARTIST%]]></Artist>
<Album><![CDATA[%ALBUM%]]></Album>
<Filename><![CDATA[%FILENAME%]]></Filename>
</MetaNow>
@anthonyeden
anthonyeden / MetaRadioProppFrexx.xml
Created March 25, 2018 07:51
MetaRadio: ProppFrexx XML Command Template
127.0.0.1:8016|<ProppFrexx><event><![CDATA[${event}]]></event><artist><![CDATA[${plstrackartistcurrent}]]></artist><title><![CDATA[${plstracktitlecurrent}]]></title><duration>${effectivesec}</duration><starttime>${effectivestart}</starttime><filename><![CDATA[${filename}]]></filename></ProppFrexx>
@anthonyeden
anthonyeden / MetaRadioSAMBroadcaster.xml
Created March 25, 2018 08:15
MetaRadio: SAM Broadcaster XML Template
<SAMBroadcaster>
<title><![CDATA[$song.title$]]></title>
<artist><![CDATA[$song.artist$]]></artist>
<duration>$song.SS$</duration>
<startTime>$NOW$</startTime>
<assetType>$song.songtype$</assetType>
<playoutId><![CDATA[$song.FILEFULL$]]></playoutId>
</SAMBroadcaster>