This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"recipient":{ | |
"type":"email", | |
"hashed":true, | |
"salt":"MASHeHawk53yBl0g", | |
"identity":"sha256$7da5d01955b57cdefd04994e98e68541e4f1c9f99ac3308d5f14485c60ac0e8f" | |
}, | |
"image":"https://dl.dropboxusercontent.com/u/7860124/ALT-Survey-Badge-2014.png", | |
"badge":"https://script.google.com/macros/s/AKfycbx5uvVcmmHweZwhIxzO0IAUrUtY_cW88Sz1B-MpquZxopvfyIY/exec?type=badge", | |
"verify":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BASE_URL = 'https://sites.google.com/a/hawksey.info/sandbox/mozilla-open-badges-issuer-example'; // Google Sites page | |
// for script to handle issuing badges see https://script.google.com/d/1wOxT8VA2mhPVR4b4v7jMTOiIa3hNkUJyAcHUzUh6sObSITyOu3wKi4NS/edit?usp=sharing | |
/** | |
* Handle form submit | |
*/ | |
function onSubmit(e) { | |
var doc = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = doc.getSheetByName("IssuedBadges"); // note: assumed sheet name | |
var email = e.namedValues['Email'][0]; // note: assumed question name with person's email address | |
var uid = getUID(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 Martin Hawksey. All Rights Reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$headerTT = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<tt xmlns=\"http://www.w3.org/2006/10/ttaf1\" xmlns:ttp=\"http://www.w3.org/2006/10/ttaf1#parameter\" ttp:timeBase=\"media\" xmlns:tts=\"http://www.w3.org/2006/10/ttaf1#style\" xml:lang=\"en\" xmlns:ttm=\"http://www.w3.org/2006/10/ttaf1#metadata\">\n<head>\n<metadata>\n<ttm:title>\nTwitter Subtitles\n</ttm:title>\n</metadata>\n<styling>\n<style id=\"s0\" tts:backgroundColor=\"black\" tts:fontStyle=\"normal\" tts:fontSize=\"16\" tts:fontFamily=\"sansSerif\" tts:color=\"white\" />\n</styling>\n</head>\n<body tts:textAlign=\"center\" style=\"s0\">\n<div>"; | |
$footerTT = "</div>\n</body>\n</tt>"; | |
// if form submitted created xml | |
if (isset($_POST['url'])) { | |
// load Simplepie - rss reader | |
require_once('scripts/simplepie.php'); | |
$url = $_POST['url']; | |
$sPg = $_POST['startPage']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Google Analytics Stats Widget | |
* | |
* Now using widget API available in WordPress 2.8 | |
* @author Spiral Web Consulting | |
**/ | |
class GoogleStatsWidget extends WP_Widget | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Name: TwEVS | |
URI: http://www.rsc-ne-scotland.org.uk/mashe/twevs/ | |
Description: Turn twitter into a cheap electronic voting system. Ask the audience to tweet a custom hashtag with their response (i.e. A, B or C or Yes/No etc) then run the pipe entering the hashtag (you should use a different hashtag for each question). | |
Author: Martin Hawksey | |
Author URI: http://www.rsc-ne-scotland.org.uk/mashe | |
Version: 1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function twitterCapture($type) { | |
// Set your username and password here | |
$user = 'rsc_ne_scotland'; // Twitter Username | |
if ($type == "json") $type .= "?callback=twitterCallback2&count=8"; | |
$tw = curl_init("http://twitter.com/statuses/user_timeline/{$user}.$type"); //grabs the JSON format of your timelines | |
curl_setopt($tw,CURLOPT_TIMEOUT, 30); // Timeout (for when Twitter is down) | |
curl_setopt($tw,CURLOPT_RETURNTRANSFER,1); // returns | |
$json = curl_exec ($tw); // Executes the cURL and puts it into the varible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user2 = ''; | |
if ($('.twitter-anywhere-tweet-box-editor').length){ | |
// New Twitter textarea tweet entry | |
user1 = extractAt($('.twitter-anywhere-tweet-box-editor').val()); | |
user2 = $('#screen-name').text().replace(/[\s\xA0]+/g,''); | |
} else { | |
if ($('.tweet.permalink-tweet').length){ | |
// status page when logged in | |
user1 = $('.tweet.permalink-tweet').attr('data-screen-name'); | |
user2 = extractAt($('.tweet-text.tweet-text-large').text()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getCSVfromGoogle($url){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_REFERER, "http://www.rsc-ne-scotland.org.uk/mashe"); | |
$arr = importCSV(curl_exec($ch), true); | |
curl_close($ch); | |
return $arr; | |
} |