maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

feature to list the history of an item #27

Closed egonw closed 6 years ago

egonw commented 7 years ago

Listing all revision of the entry in Wikidata, possibly supporting filters like, "all changes since", or "all changes by". My use case is one where I like to monitor changes to the pages I created. Using your tool and these feature I could set up a crontab allowing me to report all the changes to a set of pages (likely one CLI call for one page) since the last time I run that crontab.

maxlath commented 7 years ago

That could be done using MediaWiki Revision API I guess: https://www.wikidata.org/w/api.php?action=query&prop=revisions&titles=Q3548931&format=json&rvstart=1497020505&rvlimit=max

We could have a getRevisions function in wikidata-sdk

wdk.getRevisions('Q3548931', { start: 1497021456 })

then wrapped in wikidata-cli:

wd revisions Q3548931 --start 1497021456

Getting all revisions on pages modified by a user might be tricker though, maybe using watchlists?

I don't have much time now to work on it, but PRs are welcome!

egonw commented 7 years ago

@maxlath only get getRevisions would already fit my current needs! I'm afraid I will not find time to make a PR, tho, as I'm struggling to find enough hacking time for my own OS projects :(

maxlath commented 7 years ago

ok, I gave it a shot as a morning warm up ^^

egonw commented 6 years ago

Hi @maxlath, sorry that I did not reply since then. Back in June I was horribly busy and that did not get much better since, but I've started using your wikidata-sdk in teaching and happy this is now part of the release!

maxlath commented 6 years ago

no problem :) feel free to re-open this issue if the proposed solution is lacking regarding your needs