def items
@items ||= begin
require 'json'
@http_client ||= Nanoc::Extra::CHiCk::Client.new
status, headers, data = *@http_client.get("http://feeds.delicious.com/v2/json/#{self.config[:username]}")
raw_items = JSON.parse(data)
raw_items.enum_with_index.map do |raw_item, i|
content = raw_item['n']
attributes = {
:url => raw_item['u'],
:description => raw_item['d'],
:tags => raw_item['t'],
:date => Time.parse(raw_item['dt']),
:note => raw_item['n'],
:author => raw_item['a']
}
identifier = "/#{i}/"
mtime = nil
Nanoc::Item.new(content, attributes, identifier, mtime)
end
end
end