Skip to main content
added 111 characters in body; added 140 characters in body
Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

I have been working on another API recently so I may be a bit dull but my first impression is that the path of least resistance is to

  • pull your question(s) with answers and comments disregarding activity/creation filter (use max page size)
  • compare last activity date of the question. this will include new answers and edits on both the question and answers - if bumped you have your answer - pass go
  • compare comment count on the question and then each answer - if any have changed you have your answer - pass go
    • an obvious but unlikely hole here is if a comment is deleted and a comment is added resulting in an unchanged comment count. If this is a concern, compare comment_id

In terms of efficiency, this entails 1 (large payload) request and single iterated nested control structure for up to 100 questions *. One advantage is that if you pull with body=true, you already have your updated information.

Not as efficient as a last_activity_date that included comment activity but you work with what you have.

NOTE: this will likely break down for abnormal posts that contain >100 answers or posts with >100 comments. The only way I have found to fetch these is to perform distinct multipage pulls for answers and comments for each question, to which you would then apply the above criteria.* This will likely break down for abnormal posts that contain >100 answers or posts with >100 comments. The only way I have found to fetch these is to perform distinct multipage pulls for answers and comments for each question, to which you would then apply the above criteria.

I have been working on another API recently so I may be a bit dull but my first impression is that the path of least resistance is to

  • pull your question(s) with answers and comments disregarding activity/creation filter (use max page size)
  • compare last activity date of the question. this will include new answers and edits on both the question and answers - if bumped you have your answer - pass go
  • compare comment count on the question and then each answer - if any have changed you have your answer - pass go
    • an obvious but unlikely hole here is if a comment is deleted and a comment is added resulting in an unchanged comment count. If this is a concern, compare comment_id

Not as efficient as a last_activity_date that included comment activity but you work with what you have.

NOTE: this will likely break down for abnormal posts that contain >100 answers or posts with >100 comments. The only way I have found to fetch these is to perform distinct multipage pulls for answers and comments for each question, to which you would then apply the above criteria.

I have been working on another API recently so I may be a bit dull but my first impression is that the path of least resistance is to

  • pull your question(s) with answers and comments disregarding activity/creation filter (use max page size)
  • compare last activity date of the question. this will include new answers and edits on both the question and answers - if bumped you have your answer - pass go
  • compare comment count on the question and then each answer - if any have changed you have your answer - pass go
    • an obvious but unlikely hole here is if a comment is deleted and a comment is added resulting in an unchanged comment count. If this is a concern, compare comment_id

In terms of efficiency, this entails 1 (large payload) request and single iterated nested control structure for up to 100 questions *. One advantage is that if you pull with body=true, you already have your updated information.

Not as efficient as a last_activity_date that included comment activity but you work with what you have.

* This will likely break down for abnormal posts that contain >100 answers or posts with >100 comments. The only way I have found to fetch these is to perform distinct multipage pulls for answers and comments for each question, to which you would then apply the above criteria.

Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

I have been working on another API recently so I may be a bit dull but my first impression is that the path of least resistance is to

  • pull your question(s) with answers and comments disregarding activity/creation filter (use max page size)
  • compare last activity date of the question. this will include new answers and edits on both the question and answers - if bumped you have your answer - pass go
  • compare comment count on the question and then each answer - if any have changed you have your answer - pass go
    • an obvious but unlikely hole here is if a comment is deleted and a comment is added resulting in an unchanged comment count. If this is a concern, compare comment_id

Not as efficient as a last_activity_date that included comment activity but you work with what you have.

NOTE: this will likely break down for abnormal posts that contain >100 answers or posts with >100 comments. The only way I have found to fetch these is to perform distinct multipage pulls for answers and comments for each question, to which you would then apply the above criteria.