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
def perform(url, rules, file_name) | |
response = Net::HTTP.get_response(URI.parse(url)) | |
doc = Hpricot(response.body) | |
file = File.open(file_name, "a") | |
rules.each do |rule| | |
(doc/rule).each do |element| | |
file.puts element.inner_html | |
end | |
end | |
file.close |
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
using System; | |
using System.Net; | |
using System.Text; | |
using System.IO; | |
namespace MadMimi | |
{ | |
class Program | |
{ | |
const string MAD_MIMI_USER_NAME = "YOUR MAD MIMI LOGIN"; |
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
using System; | |
using System.IO; | |
using System.Text; | |
using System.Net; | |
namespace MadMimi | |
{ | |
class Program | |
{ | |
static string apiKey = "YOUR MAD MIMI API KEY"; |
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
package Revamp::Mail::MadMimiMail; | |
use Switch; | |
use HTTP::Request::Common; | |
use LWP::UserAgent; | |
use YAML; | |
use Data::Dumper; | |
sub new { | |
my ($class, @args) = @_; |
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 | |
/* | |
Plugin Name: Mad Mimi Archives Plugin | |
Plugin URI: http://mimi.fascinationstreet.co.za/mimi_archives.php | |
Version: 0.01 | |
Author: <a href="http://fascinationstreet.co.za/">Marc Heiligers</a> | |
Description: A plugin which displays archived newsletters from Mad Mimi in your blog | |
Distributed under the MIT license. Please don't sue me :-) |
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
<html> | |
<body> | |
<% | |
' Mad Mimi api details | |
Const MAD_MIMI_USERNAME = "" | |
Const MAD_MIMI_API_KEY = "" | |
Const MAD_MIMI_API_URL = "http://api.madmimi.com" | |
' A mini Mimi API lib | |
' ------------------------------------------------------------------------------------------------ |
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
require 'rubygems' | |
require 'httparty' | |
class MadMimi | |
include HTTParty | |
base_uri 'http://api.madmimi.com/' | |
def self.import(username, api_key, csv_data) | |
attempts = 0 | |
success = false |
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
// Simple memoization which only handles a single argument | |
// There's lots of things wrong with this code, | |
// like that it doesn't handle falsy values, for example. | |
// See below for a good discussion on memoization: | |
// http://addyosmani.com/blog/faster-javascript-memoization | |
Function.prototype.memoize = function() { | |
var fn = this, | |
cache = {}; | |
return function(arg) { | |
if(!cache[arg]) { |
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
public static void CallAPI(ParamType param) | |
{ | |
var resetServicePoint = false; | |
var origSecurityProtocol = System.Net.ServicePointManager.SecurityProtocol; | |
try | |
{ | |
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3; | |
resetServicePoint = true; | |
// Make your API call here | |
} |
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
addLoadEvent(function() { | |
var dropdowns = form.getElementsByTagName("select"); | |
for(var i = 0; i < dropdowns.length; ++i) { | |
dropdowns[i].onchange = (function() { | |
var dropdown = dropdowns[i]; | |
return function() { | |
if(dropdown.value != "") { | |
if(document.getElementsByClassName(dropdown.id).length == 0) { | |
var input = document.createElement("input"); | |
input.type = "hidden"; |
OlderNewer