Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sorted rss by date, desc

  • Loading branch information...
commit e8701d8a8319f9798b73bcbc398c3a42aaff6a83 1 parent 45ebb1c
@aguerrera aguerrera authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Transformer.fs
View
4 src/Transformer.fs
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.