Created
June 12, 2009 16:32
-
-
Save DRMacIver/128746 to your computer and use it in GitHub Desktop.
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 "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