Wikinews:Water cooler/technical

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Refresh

Archive, post


DPL broken and removed on ru.wn[edit]

See phab:T262391 and ru:Викиновости:Форум/Общий#DynamicPageList (latter thread is bilingual). —Justin (koavf)TCM 05:40, 18 September 2020 (UTC)

How to use mediawiki python API to get list of articles (in completion) under 'Latest Stories' section under any category with the dates listed?[edit]

If you say have this screen (https://i.postimg.cc/cHV97sCV/wikicat.png)

I want all the articles with date, sorted by the date under 'Latest Stories' section of any Category page (eg. Science and Technology). I'm using wikimedia python API. Can someone please give me a solution which uses the same?

thanks, —The preceding unsigned comment was added by Gdass (talkcontribs) 19:35, 27 October 2020 (UTC)


In case anyone comes across this looking for a solution: there are other ways to get dates like the date being present in the category or the first line of the content (article-text). But no direct way to get dates from the category page itself (to avoid reading the article, I've noticed that sometimes these dates are different than dates in the actual article). If someone can figure that out, then please add the solution here.—The preceding unsigned comment was added by Gdass (talkcontribs)

@Gdass: This one is rather tricky. You need to run a SQL query for this. Please see this. I don't think it is the most efficient, but it works. As far as MW APIs are concerned, unfortunately there are no direct APIs to find intersection. Explanation: Lastest stories in Category:Foo must also be in Category:Published. And it's pubilshed date is the timestamp when it was added in Category:Published (UTC time). Hope this helps.
•–• 09:45, 28 October 2020 (UTC)
What you need to find is how to connect to this server, and how to get a JSON request. Is this what you had been looking for?
•–• 13:13, 28 October 2020 (UTC)