def comment(asin, comment)
update_uri = BooklogHomeURI + '/addbook.php?mode=ItemLookup&asin='+asin
- p update_uri
+ #p update_uri
comment_page = @agent.get(update_uri)
comment_form = comment_page.form('frm')
comment_form['comment'] = comment.toeuc
puts comment_form['comment']
result_page = comment_form.submit
- puts result_page.body
+ #puts result_page.body
end
end
end
--- /dev/null
+# -*- coding: utf-8 -*-
+
+# ブクログの情報更新
+# #booklog(<ASIN>)
+# @options['booklog_userid']
+# @options['booklog_password']
+def booklog(asin)
+ require 'date'
+ require 'booklog'
+
+ user = @conf.options['booklog_userid']
+ pass = @conf.options['booklog_password']
+ booklog = Booklog::Agent.new(user, pass)
+ booklog.input([asin])
+ ""
+end
+
+def booklog_post(asin)
+ require 'booklog'
+
+ user = @conf.options['booklog_userid']
+ pass = @conf.options['booklog_password']
+ booklog = Booklog::Agent.new(user, pass)
+
+ booklog.comment(asin, @entry.alternate)
+ ""
+end
+
+if $0 == __FILE__
+ $test = true
+end
+
+if defined?($test) && $test
+ require 'test/unit'
+ require 'ldblogwriter/config'
+
+end
+
+