Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
convert bookmark from diigo to instapaper
#からRSS Formatで取得したファイルを
# import.txtとして保存して実行
# 量が多いと、Rate Limit Exceededになるので注意
require "cgi"
require "net/https"
ril ="import.txt")
unread = ril.scan(%r{<link>(.*?)</link>}m)
http ="", 443)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
unread.each do |url|
s = {
:username => "<username>",
:password => "<password>",
:url => url.first[/<!\[CDATA\[(.*?)\]/,1],
:selection => "(diigo import)"
param = { |k, v| "#{k}=#{CGI.escape(v)}" }.join("&")
puts param"/api/add", param)
puts "---------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment