Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NNTP group info
#1
How to get not only group names but group descriptions?
Reply
#2
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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)