2

If the correct place for this question is not here, please just let me know where I should do it and I'll delete it!

According to this question:
Tag feeds do not generate `Newest` questions in Slack

I'm trying to reproduce via RSS the answer from this page (I created this URL with test filters with numerous tags to make sure there are always new questions asked in a few seconds):

https://stackoverflow.com/questions/tagged/google-sheets-formula+or+python+or+javascript+or+google-apps-script+or+css+or+java+or+jquery?sort=Newest&filters=NoAnswers&uqlId=58955

enter image description here

But when using this RSS-oriented URL:

url = 'https://stackoverflow.com/feeds/tag?tagnames=google-sheets-formula+or+python+or+javascript+or+google-apps-script+or+css+or+java+or+jquery?sort=Newest&filters=NoAnswers'

I get questions that were asked even days ago when I'm actually trying to get the real-time (I don't get any URL with a question that was asked in a few seconds, as it should appear) feed of new questions that haven't been answered yet.

How should I proceed?

Additional information after answer posted by Andrew T. (https://meta.stackoverflow.com/a/418000/11462274):

My Code:

import feedparser
from time import sleep
import sys

def main():
    while True:
        url='https://stackoverflow.com/feeds/tag?tagnames=google-sheets-formula+or+python+or+javascript+or+google-apps-script+or+css+or+java+or+jquery&sort=newest'
        data = feedparser.parse(url)
        i=0
        while i < len(data):
            sof = data['entries'][i]['published']
            print(sof)
            i=i+1
        for remaining in range(10, 0, -1):
            sys.stdout.write('\r')
            sys.stdout.write('next activation in {:2d} seconds'.format(remaining))
            sys.stdout.flush()
            sleep(1)
        sys.stdout.write('\r                               ')

if __name__ == '__main__':
    main()

Response:

2022-05-11T14:28:36Z
2022-05-11T14:28:29Z
2022-05-11T14:28:17Z
2022-05-11T14:27:16Z
2022-05-11T14:27:11Z
2022-05-11T14:26:40Z
2022-05-11T14:26:21Z
2022-05-11T14:25:24Z
2022-05-11T14:24:37Z
2022-05-11T14:24:35Z
2022-05-11T14:24:34Z

2022-05-11T14:28:36Z
2022-05-11T14:28:29Z
2022-05-11T14:28:17Z
2022-05-11T14:27:16Z
2022-05-11T14:27:11Z
2022-05-11T14:26:40Z
2022-05-11T14:26:21Z
2022-05-11T14:25:24Z
2022-05-11T14:24:37Z
2022-05-11T14:24:35Z
2022-05-11T14:24:34Z

As seen, the questions published a few seconds or 1 minute ago do not appear, even if there are several of them.

1 Answer 1

2

Use &sort instead of ?sort.

For RSS feed URL with https://stackoverflow.com/feeds/tag?tagnames=<list of tags>, it already has ? as an indicator for HTTP GET parameters, and tagnames is the first parameter. To add more parameters, use & instead, such as &sort=newest.

Or alternatively, click the RSS icon below the Hot Network Question list.

It will show a popup with the URL for the feed

which is https://stackoverflow.com/feeds/tag?tagnames=google-sheets-formula+or+python+or+javascript+or+google-apps-script+or+css+or+java+or+jquery&sort=newest.

6
  • Oh, I just noticed that Shog9's answer listed tag?tagnames=...?sort=newest as an example, which actually doesn't really work (it shows "Active questions tagged ..." instead). Possibly a typo...
    – Andrew T.
    May 11, 2022 at 14:16
  • Hello @AndrewT , I'm calling my code using the link you indicated, but even though there are several questions asked a few seconds ago, none of them appears, only questions with 2,3,4,5 minutes or more. Does this have something to do with the way RSS works and can't fetch published questions in a few seconds? May 11, 2022 at 14:27
  • If you want, I can publish the code for better viewing! May 11, 2022 at 14:29
  • 1
    @BrondbyIF I believe the content of the RSS feed is cached server-side (just like many others on SE), which based on my observation is per 5 minutes (e.g. the last refresh from shown a question posted on 14:34:13, and then 14:39:39), so there's nothing you can do to get the update more quickly...
    – Andrew T.
    May 11, 2022 at 14:38
  • I understand, so, to make sure it's viable, via API I can collect in real time just like on the website or will I get myself into the same problem too? May 11, 2022 at 14:40
  • 1
    @BrondbyIF using API is more real-time, but still note the API's rate limit.
    – Andrew T.
    May 11, 2022 at 14:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .