Comments (12)
Sorry there is no function like this, but if you need such function take a look at GetRevision. This class maps absent revision to an empty article. Hope this helps?
Do you have ideas how to make it easier to use the functionalities?
from jwbf.
Parse the missing field of API result and add exists getter to Article.
Redirect information is available only at prop=info :(
from jwbf.
Feels strange to get an article and then check if it is exists. Or?
btw: why do you need to know the difference between an empty or absent article?
from jwbf.
Thanks I will look at it.
I think the library is missing documentation. I was using another library and that library have a function that return all the articles in in given category. It took me a lot of time to figure out how replace this function with this library.
I have also other questions:
- Why LIMIT is 50. MediaWiki can return up to 5000 results for bots. In the library we can't change it. I have a bot that make changes on articles that are in given category, the category contains more than 100 000 articles. The bot now will make a lot of request to the server.
- Why are the save, get methods are syncronized? Two threads can save two diffents articles in the same time and this won't lead to any error.
- Why there are methods that are coded like this:
public foo(Type bar){
...
return bar;
}
from jwbf.
- For the lack of documentation: I'm not very good in writing docs (see #22, #23, ...), but if you are, feel free to help us.
- For the LIMIT: I've also thought about this. What do you think about to create a new issue about configurable limits?
- For the other points: You are right, feels strange. Can you give me a hint where your last finding is?
from jwbf.
To be able to use foo(bar) in expressions. Very useful.
from jwbf.
do you mean this 😉
https://github.com/eldur/jwbf/search?q=foo
from jwbf.
I mean this function:
public synchronized T getPerformedAction(T answer) {
// TODO transform to throttled
performAction(answer);
return answer;
}
We don't see what the method do. It's the first time I see a method written like this. We don't know what object was changed.
I will try to help when I have time and when I figure out how things work.
from jwbf.
At the beginning of this project, immutability wasn't favored as now. So this method mutates the given answer
and returns it, so it helps to save lines.
AnyRequest request = ...
return b.getPerformedAction(request).getWhatever();
vs.
AnyRequest request = ...
b.performAction(request)
return request.getWhatever();
See: http://en.wikipedia.org/wiki/Fluent_interface
from jwbf.
I tend to close this issue, because the question could be answered with
bot.readDataOpt("ArticleName").isPresent()
from jwbf.
Why not create it as a function in MediaWikiBot?
from jwbf.
because it could save a request
MediaWikiBot bot = createNewBot();
if (bot.isArticlePresent("ArticleName")) { // first request to API
doSomenthingWith(bot.readData("ArticleName")); // second request to API
} else {
// whatever
}
vs.
MediaWikiBot bot = createNewBot();
Optional<SimpleArticle> result = bot.readDataOpt("ArticleName"); // the only request to API
if (result.isPresent()) {
doSomenthingWith(result);
} else {
// whatever
}
from jwbf.
Related Issues (20)
- watch articles HOT 39
- uploaded text != downloaded text HOT 3
- MovePage with MediaWiki 1.23.2 HOT 3
- NoClassDefFound exception when instantiating classes HOT 9
- Delete Category Pages HOT 2
- connection through a proxy HOT 2
- Invalid cookie header warning HOT 1
- Implement OAuth 1.0a authentication
- Invalid XML HOT 6
- FileUpload uses wrong input for GetApiToken HOT 8
- getArticle last revision or cached version? HOT 3
- Regexp issue HOT 1
- getText receive only 10000 characters HOT 1
- Current stable version is broken with java.lang.NoSuchFieldError: DEFAULT_USER_AGENT HOT 7
- Pointless warning when using a custom HTTP client in HTTPActionClient builder HOT 1
- Bug in obtaining multiple pages at once HOT 3
- More info on Recent Changes HOT 2
- Not working in shaded jar HOT 3
- Failed to login (Fetching a token via "action=login" is deprecated)
- Incompatible with Mediawiki 1.37 HOT 1
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 jwbf.