Giter VIP home page Giter VIP logo

userscripts's People

Contributors

eejit43 avatar elijahpepe avatar novemlinguae avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

elijahpepe

userscripts's Issues

speed idea: grab the wikicode, analyze that, and only add CSS rules for matches found in wikicode

Test pages:

Algorithm:

  • grab wikicode
  • use a simple string search to look for dictionary words
    • when found, isolate the URL and add to a list
  • only CSS add the URLs in that list

Results:

  • Much better. One run was only adding 99 rules out of 1820.
    image

Add more sources

I have a list somewhere of promising WikiProject reliable sources lists

better workflow

is there a better workflow, such as 1) get wikitext or HTML, 2) isolate usernames, 3) one API query for multiple username's perms and edit count, 4) then highlight? instead of downloading this giant list on every page? this would make UserHighlighterSimple work on other wikis too

This userscript goes through a page and gets all the usernames, does stuff, then styles their links. Copy this: https://en.wikipedia.org/wiki/User:GeneralNotability/mark-locked.js

Rip sources from featured articles

Figure out a way to crawl all featured articles and make a pivot table of their citation's domain names.

The top results, add those to CiteHighlighter as reliable.

This will get a bunch of domains that aren't listed on other lists, but that are commonly used.

refactor getPages to not use prop=revisions

You don't need revisions, just response.query.pages[n] will have missing if missing (and also known if it's a file on Commons or a user page on Meta that exists). Nardog (talk) 16:28, 27 December 2021 (UTC)

make sure old pages that fell out of the queue don't trigger the copyvio check button

So pages never get de-queued. They will get indexed by Google after 3 months, but remain in the NPP queue. The page curation toolbar still pops up too. So might as well also pop up the copyvio check button.

Assuming they really do fall out of the queue. Still not clear how falling out of the queue works.

• - make sure old pages don't trigger it. old pages won't have any curation. && creation_date within "last 6 months". action=query&list=logevents&letype=patrol

Go through WP:RSP and make updates

Update NPPSG dictionary.

Then turn on aggressive highlighting, go through WP:RSP, and make sure everything is still sync'd up correctly.

There should be some new RFCs there that are not reflected on the list. For example, Jacobin.

get it working on metawiki

https://meta.wikimedia.org/wiki/Requests_for_comment/Stop_accepting_cryptocurrency_donations#Voting

They have a couple of bolded votes, but mainly template votes. Need to refactor VoteCounter to also detect template votes. Examples:

  • {{oppose}}
  • {{ss}}
  • {{strong oppose}}
  • {{strong support}}
  • {{support}}
  • {{s}}
  • {{weak oppose}}
  • {{weak support}}

Will also need to detect synonyms. ss, strong support, s, and support all translate to support. Should sum them together and just display "support"

incorporate Nardog's advice

https://en.wikipedia.org/wiki/Wikipedia_talk:User_scripts/Archive_6#Uncaught_TypeError

User:Novem Linguae/Scripts/UserHighlighterSimple.js
Uncaught TypeError: Cannot read property 'apply' of undefined
at Object.add (:612:407)
at index.php?title=User:Novem_Linguae/Scripts/UserHighlighterSimple.js&action=raw&ctype=text/javascript:7
This bug has absolutely no effect on my user script's functionality. But it throws that warning in the browser console on every page load. Any idea how to fix it? I forked some of this code so I am not too familiar with mw.hook, $.when, etc. Thanks. –Novem Linguae (talk) 05:55, 8 July 2021 (UTC)

@Novem Linguae: mw.hook('wikipage.content').add(...) is doing nothing. Since you're executing the function (function($, mw){...}) instead of passing it as a handler, the function is executed only once as soon as the script is loaded. I would change line 7 to mw.hook('wikipage.content').add(function($content){, 83 to $content.find('a').each(function(index,linkraw){, and 177 to });, and move line 7 to after line 37 (so that the JSON fetches would be done only once, not every time wikipage.content is fired). Nardog (talk) 21:21, 16 July 2021 (UTC)

Nardog, the line 7 and 177 changes fixed the error. Awesome. The line 83 change made the script stop highlighting. I'll dig into the line 83 suggestion, and the swap 7 and 37 suggestion soon. Thank you very much for your help. –Novem Linguae (talk) 23:04, 16 July 2021 (UTC)

Weird, this revision totally works for me. Also, get mw.util.addCSS() out of the handler, or the style tags will be added every time wikipage.content is fired. If you use mw.loader.addStyleTag() you don't even have to declare a dependency (also, why add a tag for each rule instead of just one tag for all?). And I don't think it's appropriate to put the client-error opt-out (or any experimental code for that matter) in a script that's been imported by others. Nardog (talk) 00:07, 17 July 2021 (UTC)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.