If Copy(Response, Length(Response) - Length(LastPageResponse) + 1, Response := HTTPClient.Post('' + AUser + '/more', Parameters := 'page=' + IntToStr(LastPage) Parameters.Add('page=' + IntToStr(LastPage)) TimeString := FormatDateTime('ddd mmm dd hh:nn:ss UTC yyyy', AFromDate) Result := HTTPClient.Get('' + AUser) + LineBreaks LastPageResponse = '$("#more-container").hide() ' Forgot to notice, that the additional content you'll need to parse in a different way than a base page, since it's not a HTML content.įunction GetAllQuestions(const AUser: string AFromDate: TDateTime The GetAllQuestions function returns a base user's page, followed by line breaks separated content in a range from the base page to all pages from the time and page you specify. AStartPage - is a starting page from the AFromDate date time from which you want to get results.AFromDate - is a starting date time from which you want to get results.AUser - is the user name after the slash from the URL.In the GetAllQuestions function you can specify: It's posting the form data similarly like the Show more button does, but it uses a while loop (to receive all pages), which repeats until the exact constant in response is found (in code it's the LastPageResponse constant), so when the response content of the page will be changed some time and that constant won't be in the response, you will find yourself in the infinite loop. This approach is lame and quite dangerous.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |