Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working on changing the world.

Anthony Eden anthonyeden

💭
Working on changing the world.
View GitHub Profile
View gist:d3b395e0406f489b05fe
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 Jun 28, 2015
2wcom RDS Commands via Python
View gist:0a4becbde55bf565803f
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
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)
View gist:5619384
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
Tally Puller WP Plugin Sample
View data.php
<?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 Sep 20, 2016
DreamObjects Sample Upload Script (Bash)
View DreamObjectsUpload.sh
#!/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
View TrelloTimeTracker.php
<?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 / nexgen_xml_receiver.php
Created Sep 26, 2016 — forked from anonymous/nexgen_xml_receiver.php
NexGen Now Playing PHP Sample Script
View nexgen_xml_receiver.php
<?php
//GET XML data from RCS NexGen
//?nexgendata=ENCODEDXML
// The raw XML data sent from NexGen
$xml_raw = $_GET['nexgendata'];
// A simple way to convert the XML to an associative array
$xml_nexgen = json_decode(json_encode((array)simplexml_load_string($xml_raw)), 1);
@anthonyeden
anthonyeden / Zetta-LogLoadEmail.py
Created Oct 21, 2017
Zetta: Email Alerts for Flat-File Log Imports
View Zetta-LogLoadEmail.py
"""
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 Mar 25, 2018
MetaRadio Simian Pro XML Template
View MetaRadioSimian.xml
<?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 Mar 25, 2018
MetaRadio: ProppFrexx XML Command Template
View MetaRadioProppFrexx.xml
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>