DRMacIver (owner)

Revisions

gist: 128746 Download_button fork
public
Public Clone URL: git://gist.github.com/128746.git
Embed All Files: show embed
delicious_bulk_import.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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