def items
@item ||= begin
require 'json'
@http_client ||= Nanoc::Extra::CHiCk::Client.new
status, headers, data = *@http_client.get("http://twitter.com/statuses/user_timeline/#{self.config[:username]}.json")
raw_items = JSON.parse(data)
raw_items.enum_with_index.map do |raw_item, i|
content = raw_item['text']
attributes = {
:created_at => raw_item['created_at'],
:source => raw_item['source']
}
identifier = "/#{raw_item['id']}/"
mtime = Time.parse(raw_item['created_at'])
Nanoc::Item.new(content, attributes, identifier, mtime)
end
end
end