Skip to content

Instantly share code, notes, and snippets.

@ramieblatt
ramieblatt / httparty_icebox.rb
Created April 9, 2010 22:30 — forked from karmi/httparty_icebox.rb
Fixed a few issues I came across and added a Memcached (from the gem) wrapper class for the AbstractStore
# = Icebox : Caching for HTTParty
#
# Cache responses in HTTParty models [http://github.com/jnunemaker/httparty]
#
# === Usage
#
# class Foo
# include HTTParty
# include HTTParty::Icebox
# cache :store => 'file', :timeout => 600, :location => MY_APP_ROOT.join('tmp', 'cache')
@ramieblatt
ramieblatt / import_blogger_xml.rake
Created April 14, 2011 20:26
An importer of blogger xml to Ryan Stout's Blog Kit (https://github.com/ryanstout/blog_kit)
# run like so: (also see: http://blog.jayfields.com/2006/10/rake-tasks-with-parameters.html for tutorial on rake tasks, arguments etc.)
#
# with defaults:
# $ rake import_blogger_xml["db/blog_seed/blog-04-08-2011.xml"] # e.g. "db/blog_seed/blog-04-08-2011.xml
desc "Import Blogger xml into Blog Kit tables"
task :import_blogger_xml, :file_path, :needs => :environment do |t, args|
blog_kit_comment_array = []
BlogKit.instance.settings['akismet_key'] = nil # this is to turn off spam filtering because of throttling
# This will be the default blog poster user, in our case Party is our user model and Employee inherits from Party...