I’m using the “rubilicious” gem to integrate delicious into my site, and
it’s working fine. However, the items are out of order. It pulls the
most recent 10 posts, but not in descending order. This is what I’m
doing:
def setup_rubilicious
require ‘rubilicious’
r = Rubilicious.new(‘user’,‘pass’)
@d_links = Array.new
@d_descs = Array.new
@d_times = Array.new
@per_page = 10
bookmarks = r.recent(‘rpheath’,@per_page)
bookmarks.each do |post|
@d_links << post[‘href’]
@d_descs << post[‘description’]
@d_times << post[‘time’]
end
end
So, essentially I need to sort @d_links, @d_descs, @d_times according to
the date in descending order, so they all match up. Is there a better
way to do this than use 3 variables? It would be ideal to have one
variable, and refer to the “time” or “description” or “href”. Something
like:
@delicious.each do |post|
<a href="<%= post[“href”] %>" title="<%= post[“time”] %>"><%=
post[“description”] %>
end
But if that’s not possible, what is the best way to sort all three
variables based on the time??? Thanks!