Page MenuHomePhabricator

47: Add an option to watch all wikis every the user has an account in Global Watchlist
Closed, DeclinedPublic

Description

Add an option to the global watchlist to watch every wikis where the user has an local account.

Acceptance criteria

  • It should detect every SUL wikis where the user has an local account.
  • Perform a search and store it's result in a personal JS file to avoid searching again when one refreshes the watchlist.
  • Also add an option to refresh the previous search results.

Alternative proposal

Add an auto-complete feature in site fields which will suggest sites as one types. Suggestions should only be from wiki list where the user has accounts like I said above.

Event Timeline

@Masumrezarock100 proposed implementation:

  • Create a helper function, to retrieve the list of all SUL wikis with an account attached
  • Add an option to the settings page, in addition to "add a site", to "add all SUL sites"
  • When selected, retrieve all SUL wikis, and set the list of sites to be equivalent to the list retrieved

I'm not sure what the "refresh the previous search results" refers to - this would be run each time the option was selected

DannyS712 renamed this task from Add an option to watch all wikis every the user has an account in Global Watchlist to 47: Add an option to watch all wikis every the user has an account in Global Watchlist.Oct 14 2019, 11:00 PM

Getting all SUL wikis with merged accounts:

Query
new mw.Api().get( {
    action: 'query',
    meta: 'globaluserinfo',
    guiprop: 'merged',
} ).done( function( response ) { console.log( response ); } );

I'm not sure what the "refresh the previous search results" refers to - this would be run each time the option was selected

I meant "clear the stored search results list, and request a new list using API". For users like me, and you who have unified their accounts all Wikimedia projects (have created local accounts on all Wikimedia sites), the list would be pretty big and it will take some time to retrieve the data from the server. So that is why I am saying it should store the search results in a personal JS file and retrieve the list from there instead of the server. And refresh it when the user tells the script to.

I wasn't going to store the result unless it was saved - it only took a few seconds to run via the console

@Masumrezarock100 for now, from the command line, you can use GlobalWatchlist.config.siteList = (await GlobalWatchlist.API('get', { action: 'query', meta: 'globaluserinfo', guiprop: 'merged' }, 'getAttachedAccounts')).query.globaluserinfo.merged.map((s) => s.url.replace(/https:\/\/|\.org/g, '')) and then hit the reset changes button

@Masumrezarock100 what about adding a parameter, allsites=, that, if set, results in (that time) going over all account sites, rather than the list (i.e. https://meta.wikimedia.org/wiki/Special:BlankPage/GlobalWatchlist?allsites=true allows overriding temporarily)

@Masumrezarock100 what about adding a parameter, allsites=, that, if set, results in (that time) going over all account sites, rather than the list (i.e. https://meta.wikimedia.org/wiki/Special:BlankPage/GlobalWatchlist?allsites=true allows overriding temporarily)

Good idea!

@Masumrezarock100 what about adding a parameter, allsites=, that, if set, results in (that time) going over all account sites, rather than the list (i.e. https://meta.wikimedia.org/wiki/Special:BlankPage/GlobalWatchlist?allsites=true allows overriding temporarily)

Good idea!

Yeah, except I just tried it, and it stalled around ln.wikipedia - I don't think this is going to be possible

@Masumrezarock100 what about adding a parameter, allsites=, that, if set, results in (that time) going over all account sites, rather than the list (i.e. https://meta.wikimedia.org/wiki/Special:BlankPage/GlobalWatchlist?allsites=true allows overriding temporarily)

Good idea!

Yeah, except I just tried it, and it stalled around ln.wikipedia - I don't think this is going to be possible

Does that mean if I try to add all sites manually, the script would not be able to handle it?

@Masumrezarock100 it'll work at first, but will likely stall out

@Masumrezarock100 it'll work at first, but will likely stall out

Hmm. So API query times out. Would it be possible for your script to get Database access so that it can query watchlist entries directly?

@Masumrezarock100 it'll work at first, but will likely stall out

Hmm. So API query times out. Would it be possible for your script to get Database access so that it can query watchlist entries directly?

Its not the API - I think its browser memory at that point. Scripts cannot query the databases

Declining per above comment, it seems impossible to query that many sites without a supercomputer.

@Masumrezarock100 it'll work at first, but will likely stall out

Hmm. So API query times out. Would it be possible for your script to get Database access so that it can query watchlist entries directly?

Its not the API - I think its browser memory at that point. Scripts cannot query the databases

How about porting the GW to Toolforge and get it DB access somehow? Crosswatch was hosted on Toolforge.

@DannyS712 Hey but you can do the alternative proposal, right? I mean adding an auto-complete feature?

Maybe - no idea how to make text autocomplete. As for toolforge - access to personal watchlists via grants might work, but its a very different direction for the script