Skip to content

Instantly share code, notes, and snippets.

@brendanc
brendanc / litmusapi-example.pl
Created June 28, 2013 21:30
Slightly different Litmus API perl sample with 2 functions create_test and get_test. Create takes no parameters but get takes the id of the test you want to retrieve.
#!/usr/bin/perl
use 5.006;
use SOAP::Lite 'trace', 'debug' ;
# Sample code to create a new email test using Litmus' Reseller Api
# This sample uses SOAP:Lite, available at: http://www.soaplite.com/
$api_key = "api-key";
@brendanc
brendanc / optiona.html
Last active December 18, 2015 13:59
Example of how to time track multiple runners with ajax posting to a url in the background.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Option A</title>
<style type="text/css">
.button {
-webkit-box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
-moz-box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
<?php
/* Here is some generic error handling code, not related to actual sample */
set_error_handler('my_error_handler');
set_exception_handler('my_exception_handler');
function my_exception_handler($e) {
exit('Houston! We have a problem: <br />'.$e);
}
@brendanc
brendanc / pr_parse.rb
Created November 6, 2012 04:15
parse srr Thursday results to csv
require 'open-uri'
require 'nokogiri'
base_url = "http://srr.org"
doc = Nokogiri::HTML(open("http://www.srr.org/events/thursday-night-run/index.php"))
divisions = ["Men's Open", "Women's Open", "Men's Masters", "Women's Masters"]
results = []
doc.xpath('//a[starts-with(@href, "/events/thursday-night-run/")]').each do |node|
href = node['href']
@brendanc
brendanc / pr.rb
Last active October 12, 2015 03:37
Scrape srr.org for Thursday night run results
require 'open-uri'
require 'nokogiri'
# This is the original parsing script that inspired this app.
# Left here for reference and debug/troubleshooting.
#
def crawl(doc, base_url, name_to_match)
base_url = "http://srr.org"
results = []
@brendanc
brendanc / create-email-test-using-cust-api.php
Created April 23, 2012 04:13
Create an email test using the Litmus customer API
<?php
/* Here is some generic error handling code, not related to actual sample */
set_error_handler('my_error_handler');
set_exception_handler('my_exception_handler');
function my_exception_handler($e) {
exit('Houston! We have a problem: <br />'.$e);
}
@brendanc
brendanc / hiding-in-web-mails.html
Created November 17, 2011 17:00
Hiding Stuff in Web Mails
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div>
@brendanc
brendanc / litmus_newtest.pl
Last active September 27, 2015 22:58
Create a Litmus Email Test using the Litmus Resller API and Perl
#!/usr/bin/perl
use 5.006;
use SOAP::Lite 'trace', 'debug' ;
# Sample code to create a new email test using Litmus' Reseller Api
# This sample uses SOAP:Lite, available at: http://www.soaplite.com/
$api_key = "api-key";
@brendanc
brendanc / litmus-newtest.py
Created July 12, 2011 16:19
Create a Litmus Email Test using the Litmus Resller API and Python
import suds
from suds import WebFault
from suds.client import Client
from suds.xsd.sxbasic import Import
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
# Sample code to create a new email test using Litmus' Reseller Api