Atozed Forums
NNTP group info - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Indy (https://www.atozed.com/forums/forum-8.html)
+--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html)
+--- Thread: NNTP group info (/thread-1463.html)



NNTP group info - AndrzejB - 01-03-2020

How to get not only group names but group descriptions?


RE: NNTP group info - rlebeau - 01-03-2020

You have to send the server a 'LIST NEWSGROUPS' command. However, TIdNNTP does not implement that particular command at this time (it currently only implements 'LIST', 'LIST OVERVIEW.FMT', and 'LIST EXTENSIONS'), so you will have to send the command manually and then parse the response yourself, eg:

Code:
var
  LResponse: TStringList;
  I, J: Integer;
  LName, LDesc: string;
begin
  LResponse := TStringList.Create;
  try
    IdNNTP1.SendCmd('LIST NEWSGROUPS', 215);
    IdNNTP1.IOHandler.Capture(LResponse, IndyTextEncoding_8Bit);
    for I := 0 to LResponse.Count-1 do
    begin
      J := FindFirstOf(' '#9, LResponse[I]);
      LName := Copy(LResponse[I], 1, J-1);
      LDesc := Copy(LResponse[I], J+1, MaxInt);
      ...
    end;
  finally
    LResponse.Free;
  end;
end;