01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
--- rubilicious.rb 2005-05-30 10:25:34.000000000 +0900
+++ /usr/local/lib/ruby/site_ruby/rubilicious.rb 2006-08-11 14:08:27.465867368 +0900
@@ -39,6 +39,7 @@
require 'uri'
require 'time'
require 'net/http'
+require 'net/https'
require 'rexml/document'
class String
@@ -254,10 +255,11 @@
url = "#{base}/#{url}"
# connect to delicious
- http = Net::HTTP.Proxy(proxy_host, proxy_port).new(uri.host, uri.port).start
+ http = Net::HTTP.Proxy(proxy_host, proxy_port).new(uri.host, uri.port)
+ http.use_ssl = true if uri.scheme == "https" # enable SSL/TLS
# get URL, check for error
- resp = http.get(url, @headers)
+ resp = http.start.get(url, @headers)
raise "HTTP #{resp.code}: #{resp.message}" unless resp.code =~ /2\d{2}/
# close HTTP connection, return response
@@ -330,7 +332,7 @@
# set API URL (note that this can be changed by the user later)
@base_uri = opt['base_uri'] ||
ENV['RUBILICIOUS_BASE_URI'] ||
- 'http://del.icio.us/api'
+ 'https://api.del.icio.us/v1'
# set user agent string
user_agent = opt['user_agent'] ||