This is now live at https://stream.wikimedia.org/v2/stream/page-links-change
From some initial testing it looks to be working well for links added & removed, including page creations. However, it doesn't catch links removed by being on a page that gets deleted. Undeleting the page counts as a page creation and tracks the link addition(s).
|Open||None||T199189 [2.3] External links/references event stream|
|Resolved||bmansurov||T115119 Create a feed or log of changed links on Wikimedia projects|
|Resolved||daniel||T216249 page-links-change stream doesn't capture links on page deletion|
Indeed, haven't thought about that. On page deletion no LinksUpdate is scheduled, LinksDeletionUpdate is used instead which doesn't call a hook we use to construct the event.
Also, the hook we use for page deletion, ArticleDeleteComplete is run after the links are already deleted from the links tables. I guess we could listen to ArticleDelete hook, and grab the existing links with $wikiPage->getTitle()->getLinksFrom() for local links and either create a convenience method in the Title for external links or supply additional parameters to grab them.
Undeleting the page counts as a page creation and tracks the link addition(s).
I cannot reproduce this part. Undeleting the page doesn't result in link additions for me. Can you please double check if that's still true?
@Pchelolo thanks for looking into this. I want to see if I can share and reuse what we have already.
@bmansurov Strange. I just reproduced it at User:Samwalton9/sandbox10 (the most recent deletion logged at https://en.wikipedia.org/wiki/Special:Log?type=delete&user=&page=User%3ASamwalton9%2Fsandbox10&wpdate=&tagfilter=&subtype=).