Permalink
Browse files

sorted rss by date, desc

  • Loading branch information...
1 parent 45ebb1c commit e8701d8a8319f9798b73bcbc398c3a42aaff6a83 @aguerrera aguerrera committed Jan 19, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Transformer.fs
View
@@ -3,6 +3,7 @@
open System
open System.Collections.Generic
open System.IO
+open System.Linq
open System.Security.Cryptography
open System.Text
open System.Text.RegularExpressions
@@ -154,7 +155,8 @@ let create_rss (posts:IEnumerable<Page>) (url:string) (title:string) (desc:strin
feed.Channel.Copyright <- author
feed.Channel.TimeToLive <- 60
feed.Channel.LastBuildDate <- DateTime.Now.ToUniversalTime()
- for p in posts do
+ let sortedposts = posts |> Seq.toList |> List.sortWith (fun px py -> DateTime.Compare(py.Created, px.Created) )
+ for p in sortedposts do
let itemurl = new Uri(url + "/" + p.Url)
let item = new Argotic.Syndication.RssItem()
item.Guid <- new Argotic.Syndication.RssGuid(itemurl.ToString(),true)

0 comments on commit e8701d8

Please sign in to comment.