Skip to content

Instantly share code, notes, and snippets.

@DRMacIver
Created June 12, 2009 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DRMacIver/128746 to your computer and use it in GitHub Desktop.
Save DRMacIver/128746 to your computer and use it in GitHub Desktop.
require "rubygems"
require "json"
require "httparty"
module Delicious
include HTTParty
base_uri "https://api.del.icio.us/v1"
basic_auth ARGV[0],ARGV[1]
def self.add_post(it)
post("/posts/add", :query => it)
end
end
JSON.parse(IO.read(ARGV[2])).each do |post|
puts "Importing #{post["description"].inspect}"
Delicious.add_post(post)
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment