Comments (4)
Are you still interested in mediawikibot?
If yes you might look at my fork. I more or less fixed this issue by moving away from defining global constants.
This changes the use of mediawikibot. With these changes you have to use it like this:
require_once('mediawikibot.class.php');
$api = 'http://your.mediawiki.installation/wiki/api.php';
$wiki = new MediaWikiBot($api);
$success = $wiki->login(null, 'bot', 'password');
Do you want to give it a try?
from mediawikibot.
Looks good to me.
I see you contributed to a Jeroen de Dauw's repository.
You could like this presentation he made about short functions if you wish to further improve the class: http://jeroendedauw.github.io/slides/craftmanship/functions/#/1
Especially slide 23 about function arguments http://jeroendedauw.github.io/slides/craftmanship/functions/#/23
According this pattern, bot and password could be class properties to define before to call the login method, method without any argument.
from mediawikibot.
Thanks for the hint for further improving the code!
For the records: I did not really contribute to one of Jeroen de Dauws project. I just pointed out a small issue with the composer requirements of ParamProcessor.
But I am interested in writing good code and I did consider making user name and password a parameter of the constructor but decided to go for parameters of login. But I think you (and Jeroen) have a point and I will change that.
In the meantime I made some other changes that make the class really work for me (there were some issues). I will push them as soon as possible to my fork (and create some pull requests in this repo).
from mediawikibot.
Send the requests and I'll pull them in. I'll also be updating this over the next week or 2.
from mediawikibot.
Related Issues (3)
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 mediawikibot.