On 17-02-2011 18:50, Angus Robertson - Magenta Systems Ltd wrote:
>  http://sourceforge.net/projects/simplerss/
also use Indy HTTP, a complex XML project.
In this case the Indy stuff is used only to format datetime values, very easy to replace. There is also an TIdHTTP component, used only in the LoadFromHTTP method, not really needed and easily replaceable by the ICS THttpCli.

Using the bellow function, updating a local rss.xml file from that TeamICS e-mail client is as easy as this:

   if PostToRssFeed.checked and
   AddEntryToRSSFeed('c:\path\to\the\local\rss.xml', 'email.subject',
   'email.message', 'http://url/to/the/update') then
   begin
   //upload updated c:\path\to\the\rss.xml file online
   end;

- Global FormatSettings, related to DateTime format, should also be set to English defaults, if Windows regional settings are different.

- The local feed file can be started by grabbing an online feed, fill the header fields with relevant ICS info, and removing all the <item></item> items.

rss feed specifications
http://cyber.law.harvard.edu/rss/rss.html

------------------------------------------------------------

uses
SimpleRSS, SimpleRSSTypes;

function AddEntryToRSSFeed(const aRSSFilename, aTitle, aDescription, aLink: string): boolean;
var
  SimpleRSS: TSimpleRSS;
begin
  result := false;
  SimpleRSS := TSimpleRSS.Create(nil);
  try
    SimpleRSS.LoadFromFile(aRSSFilename);
    with SimpleRSS.Items.Add do
    begin
      Title := aTitle;
      Description := aDescription;
      Link := aLink;
      GUID.Include := true;
      PubDate.DateTime := now;
    end;
    SimpleRSS.GenerateXML;
    SimpleRSS.SaveToFile(aRSSFilename);
    result := true;
  finally
    SimpleRSS.free;
  end;
end;
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to