http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11751
Revision: 11751 Author: drtrigon Date: 2013-07-13 18:21:11 +0000 (Sat, 13 Jul 2013) Log Message: ----------- new feature; add datetime of claim edit as reference
Modified Paths: -------------- trunk/pywikipedia/subster.py
Modified: trunk/pywikipedia/subster.py =================================================================== --- trunk/pywikipedia/subster.py 2013-07-13 12:25:31 UTC (rev 11750) +++ trunk/pywikipedia/subster.py 2013-07-13 18:21:11 UTC (rev 11751) @@ -595,8 +595,18 @@ [{"snaktype": "value", "property": "p%s" % propid, "datavalue": {u'type': u'string', - u'value': datapage.title()}},]}, + u'value': datapage.title()}}, + {"snaktype": "value", + "property": "p585", # point in time + #"property": "p578", # Sandbox-TimeValue + u'value': {u'after': 0, + u'precision': 11, + u'time': u'+0000000%sZ' % pywikibot.Timestamp.now().isoformat().split('.')[0], + u'timezone': 0, + u'calendarmodel': u'http://www.wikidata.org/entity/Q1985727', + u'before': 0}}},]}, comment=summary) + #print data['timestampFIDE'], pywikibot.Timestamp.now().isoformat()
def get_var_regex(self, var, cont='.*?'): """Get regex used/needed to find the tags to replace.