I am trying to create a stream that includes Twitter data + my app's but I'm having trouble sorting them because their time stamps are formatted in different ways. This is my code:
answers = Answer.find(:all, :conditions => {:user_id => @user_id }, :limit => 20)
tweets = Twitter::Search.new(params[:username]).to_a
@feed = (answers + tweets).sort_by(&:created_at)
these are the formats on time:
<#Hashie::Mash created_at="Tue, 22 Jun 2010 04:41:23 +0000"...
<Answer id:... created_at: "2010-06-15 02:13:40"
Any help would be greatly appreciated.