2

After having changed the primary tag for a platform on Stack Overflow, I need to update some RSS feeds. I expected that I would be able to just change the old tag to the new tag and get similar results. However, that's not happening with the following Stack Overflow RSS feed in Slack:

/feed subscribe stackoverflow.com/feeds/tag/devops-services+and+ibm-cloud?sort=newest

When I add this link, instead of getting an RSS feed of the newest content tagged as and , I am getting a feed of the active content with those tags.

How do you correctly add the sort parameter to the end of the RSS link? I have done Google searches and came across this page, but it didn't solve my issue: What other hidden or inobvious RSS feeds are available on Stack Exchange and its sites?

Update A colleague asked me to try this URL:

/feed subscribe stackoverflow.com/feeds/tag/ibm-cloud+and+devops-services?tab=newest

While the RSS feed worked, it still did not produce the Newest results for the tag. Here's the results of the first few entries in the feed: enter image description here

Here's the list of most recent entries on Stack Overflow for those tags. The 2nd entry "Bluemix toolchain..." is NOT listed in the RSS feed so I know it is truly not a listing of the Newest entries. enter image description here

11
  • 1
  • @rene Hi Rene. I tried that and it doesn't work. It results in the Active feed. Dec 12, 2017 at 20:59
  • Your question states a different url and I do get slightly different results. So I'm not sure what is off ...
    – rene
    Dec 12, 2017 at 20:59
  • Not too familiar with Slack; any chance it's stripping the querystring?
    – Shog9
    Dec 12, 2017 at 21:03
  • @rene Slack tells me that the feed URL that you suggested is not a legitimate URL. It also seems that it does not like the "tagnames" parameter. If you look at your URL in a browser, it says Newest questions, but then the dates are out of order. Dec 12, 2017 at 21:04
  • 3
    Hmm... rene's URL should route to the exact same logic as yours; this highly suggests Slack is ignoring the querystring portion of the URL for some reason.
    – Shog9
    Dec 12, 2017 at 21:11
  • PSA: everyone make sure they're looking at <published> not <updated>; for a newest sort, correct behavior should have the former in descending order, not the latter. (which date Slack uses I cannot say)
    – Shog9
    Dec 12, 2017 at 21:27
  • @shog9 We found that the feed URL (stackoverflow.com/feeds/…) will work in a browser, but that URL is not W3C-compliant (validator.w3.org/feed/#validate_by_uri) apparently. This URL was created based on the "What other hidden..." URL that I referenced in my post. Slack requires a W3C-compliant RSS feed URL and the feed URL is not valid syntax. It doesn't answer my question on how to get it an RSS feed of newest questions for tags to work. Dec 12, 2017 at 21:58
  • Big complaint there is that this question contains an escape (literally - character #27, twice in the code block). We should probably be stripping control characters, but I doubt that's causing problems with out of order posts.
    – Shog9
    Dec 12, 2017 at 22:04
  • Why is it that stackoverflow.com/feeds/… and stackoverflow.com/feeds/… (with %22 replacing ") give two different result sets? It's the same URL. Obviously, we are continuing to test by wrapping the tag names with characters to see if we can solve it. But, no dice so far. Dec 12, 2017 at 22:14
  • Because only the first URL specifies a valid option for sort. See my answer.
    – Shog9
    Dec 12, 2017 at 22:29

2 Answers 2

1

Every entry in the feed has two dates associated with it: updated and newest

    <published>2017-12-12T22:06:27Z</published>
    <updated>2017-12-12T22:06:27Z</updated>

If nothing has happened to a given question since it was first posted, those dates will be the same; otherwise, the updated date will reflect the time of the last change (edit, answer, etc).

Specifying the "newest" sort order ensures that the entries are returned in newest-first published order; if your feed-reader displays them in the order they're returned, you'll see them listed newest-first.

The screenshot you posted appears to be from Firefox, which does respect the sort order, but only displays the updated date - so you'll see the dates out of order if you retrieve the new questions feed.

A few other notes:

  • There are two acceptable URL formats: /feeds/tag?tagnames=<tagnames> and /feeds/tag/<tagnames>.
  • Tag names should not be quoted. It doesn't seem to hurt anything, but doesn't help either.
  • Tag names should be URL-encoded if need-be (this returns C questions; if you want C# questions, you need this)
  • Specify a sort order via the sort querystring parameter.
  • Valid sort orders are: active, newest, featured, votes.
    • default is active
    • these are not case-sensitive; NeWeSt is the same as newest
    • they cannot be quoted however. ?sort="newest" == ?sort=mostawesome == sort=active == (no sort specified at all).
  • "and" is the default operator for tag combos; you can include it or omit it as you please. If you want all questions in either tag, you would have to specify "or".

So for your needs, any of these URLs should work:

...while any of the following will not do what you want:

You should post a screenshot of what you're seeing in Slack. It may just be rendering the updated date as well, in which case you're fine. Or, as I suspect, it may be stripping the querystring, in which case that's a bug on their end that they'll have to fix for you to ever get what you want.

2
  • There is definitely something weird in Slack going on. https://stackoverflow.com/feeds/tag/ibm-cloud+and+devops-services?sort=newest doesn't work (as in refuses to accept the url) but https://stackoverflow.com/feeds/tag/ibm-cloud+and+java?sort=newest does. It looks like the second hyphen-minus is sending Slack onto a wrong path. Tried encoding the + and - as well in Slack without success. Normal feeds (for single tags) work or combinations of non-hyphened tags work as well.
    – rene
    Dec 12, 2017 at 22:40
  • I've submitted feedback to Slack to see what they say. I will update this post when I have more information in case other people run into a similar issue. Dec 15, 2017 at 17:40
0

I am happy to say that between the Stack Overflow Community and Slack that tags with hyphens in RSS feeds will now work correctly in Slack. Slack completed a fix to strip out errant control characters prior to parsing the RSS XML. I have verified that the fix works. Here is an example Stack Overflow RSS feed that works in Slack: /feed subscribe https://stackoverflow.com/feeds/tag?tagnames=ibm-cloud+devops-services&sort=newest

Thanks to everyone involved in the fixing this issue, which should have a positive impact on people that are looking for questions for their area of interest.

You must log in to answer this question.

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