' Gambas module file

Public Sub Main()
  Dim sRealInFile As String = "test.xml"
  Dim sInFile As String = Temp$()
  Dim sOutFile As String = Temp$()
  Dim sDiff As String
  Dim hRss As New Rss
  Dim hItem As New RssItem

  Copy sRealInFile To sInFile
  hRss.FromString(File.Load(sInFile))
  File.Save(sOutFile, hRss.ToString())

  System.Shell = "/bin/bash"
  Shell Subst$("diff -u <(sort &1 | sed 's/ *$//' | sed 's/^ *//') <(sort &2 | sed 's/^ *//')", sOutFile, sInFile) To sDiff
  Print sDiff
  Print "---"

  hRss = New Rss
  hRss.Title = "Date test"
  hRss.Pub = New RssDate(DateAdd(Now, gb.Hour, -11))
  hRss.LastBuild = New RssDate(DateAdd(Now, gb.Hour, -11), "+0800")
  hRss.Add(hItem)
  hItem.Title = "Blank RssDate"
  hItem.Pub = New RssDate
  Print hRss.ToString()
End
