The only possible practical category RSS feeds are getting the history of the category page, and not of pages categorized there (see Help:Feeds for more info). You could get the RSS feed of the wiki activity, but that is not practical for getting the most recent page on which that given category was added. Instead it would be much better to use the API, like this:
$.getJSON("/api.php?action=query&format=json&list=categorymembers&cmtitle=Category:Featured_Articles&cmsort=timestamp&cmnamespace=0&cmprop=title|timestamp&cmlimit=500", function(data) { var a = data.query.categorymembers; // pages array console.log("Most recent featured page: " + a[a.length-1].title); });
However, this method has two main downsides:
A good solution would be to create a special MediaWiki page that contains the name of the current featured page (so yes- manualy), and then get it using the API as well:
$.getJSON("/api.php?action=query&format=json&prop=revisions&titles=MediaWiki:FeaturedPage&rvprop=content&cb=" + new Date().getTime(), function(data) { var a = data.query.pages; for (var pageid in a) { var b = a[pageid].revisions[0]["*"]; console.log("Most recent featured page: " + b); } });
The method above (on which MediaWiki:FeaturedPage is the page that contains the title) is also good in particular, as it also allows you to insert to that MediaWiki page (if you want some more advanced options rather than the featured page's page title) pure JSON and treat it like this when getting the page's content (using JSON.parse(b)
or $.parseJSON(b)
. This will provide an easy-to-get custom info about the page and select how to treat it.