soscripted / sox

Stack Overflow Extras: a userscript for the Stack Exchange websites to add a bunch of optional toggle-able features
http://stackapps.com/q/6091/
MIT License
72 stars 15 forks source link

Find if a question is a HNQ from API #425

Closed double-beep closed 4 years ago

double-beep commented 5 years ago

This implements a feature request

Before, the userscript checked if a question was hot from https://stackexchange.com/hot-questions-for-mobile. However, since mid-March, there's a revision item which says when a question became HNQ. This is also in the API as a comment: "Became Hot Network Question ".

Checking if there's such comment in the post (via revisions-by-ids method) and if its creation_date is shorter or equal to 259200 seconds (3 days) does what was done before.

double-beep commented 4 years ago

I have fixed an additional (rare) bug which is caused when you're part of a team. I have addressed your review - feel free to merge that!

shu8 commented 4 years ago

Thanks for the changes! (and sorry if they seem minor!)

One final (promise!) thing: could you drop/revert the last commit you made for the SO teams bug fix? I just merged your #436 PR, so we can get rid of this logic now :)

double-beep commented 4 years ago

No, reverting will break it again. The bug is intended to fix active team posts in SO's front page. See an example (from page https://stackoverflow.com):

image

The element in parentheses is .question-summary which apparently doesn't have an id attribute.

image

shu8 commented 4 years ago

Oh I see, sorry - that makes sense! :)