Skip to content

Instantly share code, notes, and snippets.

View simonwheatley's full-sized avatar

Simon Wheatley simonwheatley

View GitHub Profile
// for debug : trace every event
// var originalTrigger = wp.media.view.MediaFrame.Post.prototype.trigger;
// wp.media.view.MediaFrame.Post.prototype.trigger = function(){
// console.log('Event Triggered:', arguments);
// originalTrigger.apply(this, Array.prototype.slice.call(arguments));
// }
// custom state : this controller contains your application logic
wp.media.controller.Custom = wp.media.controller.State.extend({
@simonwheatley
simonwheatley / scrape_tweets.rb
Created March 25, 2012 14:50 — forked from stefl/scrape_tweets.rb
Download all tweets from the twitter search API for a given search term (limited to their maximum of 1500)
#! /usr/bin/env ruby
search_term = ARGV[0]
if search_term
time = Time.now
directory_path = File.dirname(__FILE__) + "/tweets/" + search_term + "_" + time.to_i.to_s
FileUtils.mkdir_p(directory_path)
directory = Dir.new(directory_path)
(1..15).each do |i|
`curl "http://search.twitter.com/search.json?q=#{search_term}&rpp=100&page=#{i}&include_entities=true&result_type=mixed" > #{directory.path}/#{i}.json`
end