Comments (2)
Here's a rough start for a protection method: https://github.com/elifoster/gp-work-utils/blob/01f3b54e160e9e4fc3f4298d96ec6fb5a5e555c3/lib/butt_extensions.rb#L21-L31
def protect(page)
params = {
action: 'protect',
title: page,
cascade: true,
protections: 'edit=sysop|move=sysop',
expiry: 'never|never',
reason: 'High traffic page',
token: get_token
}
post(params)
end
from mediawiki-butt-ruby.
Doesn't look awful. I would add more parameters of course, and perhaps String constants for the expiration date. Or the method would take whatever Ruby's time stamp object is, and we could have constants for the max value of that, and just convert that to the String "never" if equal.
from mediawiki-butt-ruby.
Related Issues (20)
- get_category_members should pass limit last
- `move` redirect param is reversed
- NoMethodError in get_contrib_count HOT 1
- Methods with specified hash arguments have annoying behavior
- NoMethodError in get_templates_in_page for pages without templates
- Make `use_continuation: true` and `assertion: :bot`the default HOT 4
- Export/import API support HOT 3
- Allowing different formats HOT 2
- MW 1.28 / 1.29 support HOT 1
- Change defaults for initialize
- Removal of unnecessary post params
- Logout does not work.
- MW 1.31 Support HOT 1
- MW 1.32 Support
- Remove custom limiting on continued queries HOT 1
- Support uploading local files
- MediaWiki::Utils.encode_url improvements HOT 1
- How do I get a category URL? (article URL too) HOT 4
- get_userlists methods fail with NoMethodError when user does not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediawiki-butt-ruby.