I am using Python and MySQL to query mediawiki database to get the current status of articles (i.e. whether the article is FA, GA, GAN etc.) but have been unable to do so.
I know current status is stored in the old_text
field of the text table. I was trying to something like:
loc = select (locate('currentstatus', old_text))
query = ('select substring(old_text, '%s', 20) from wikidb where page_id = 1234' % (loc))
but unfortunately loc gives the first occurrence of currentstatus
and not the last which is not very 'current' since the newest/latest status is on the bottom.
I am not sure how to fix it or if I am using the right approach.