You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-25Lines changed: 17 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,7 @@ To set up JavaMediawikiBot for an IDE, run `./gradlew eclipse` or `./gradlew ide
10
10
11
11
### Making a Wiki Family
12
12
13
-
A wiki family is a group of wikis that a bot can see and edit. It also
14
-
contains information pertinent to the wikis.
13
+
A wiki family is a group of wikis that a bot knows about, and hence can edit. It also stores wiki specific information.
15
14
16
15
To make a new wiki family, simply run `src/WikiBot/MediawikiData/FamilyGenerator.java`.
17
16
This can be done via your IDE (console required), or through the command line:
@@ -33,22 +32,29 @@ these two classes:
33
32
34
33
When extending a class, the constructor must include either:
35
34
36
-
`
37
-
super(String family, String homeWikiLanguage)
38
-
super(File family, String homeWikiLanguage)
39
-
`
35
+
`super(String family, String homeWikiLanguage)`
40
36
41
-
`family` specifies a wiki family file. A bot may then access the wikis in the family file. A String `family` refers to a default included wiki family, and must be "Scratch", "DwarfFortress", or "Wikipedia". A File `family` simply must point to a wiki family file.
37
+
`super(File family, String homeWikiLanguage)`
38
+
39
+
`family` specifies a wiki family file. A bot may then access the wikis in the family file. A String `family` refers to a default included wiki family, and must be "Scratch", "DwarfFortress", or "Wikipedia". A File `family` must point to a local wiki family file.
42
40
43
41
`homeWikiLanguage` specifies the default wiki of a bot.
44
42
45
43
### Coding the bot.
46
44
47
-
Half of the API commands are recommended used raw, half are not. This can be checked in the command's class documentation.
45
+
JavaMediawikiBot offers two ways to accomplish what you want.
46
+
47
+
GenericBot methods are abstractions of the Mediawiki API, and are mostly for querying data.
48
+
49
+
APIcommand classes are also abstractions to the Mediawiki API, and are meant to be used as
50
+
Objects. For example:
48
51
49
-
If a command is recommended used raw, then simply run `APIcommand(APIcommand command)`.
52
+
```
53
+
APIcommand command = new AppendText(loc, "\n[[de:Scratch Katze]]", "This page needs an interwiki. ^.^ ");
54
+
proposeEdit(command);
55
+
```
50
56
51
-
If a command is not recommended user raw, then use GenericBot methods.
57
+
Half of the API commands are recommended used raw, half are not. This can be checked in the command's class documentation. If not recommended used raw, use GenericBot methods instead.
52
58
53
59
### Tips
54
60
@@ -77,18 +83,4 @@ Useful bot methods and bot settings may be found in various places.
77
83
78
84
`src/WikiBot/core/NetworkingBase.java`
79
85
80
-
* For logger methods.
81
-
82
-
JavaMediawikiBot uses several classes to store data. A few classes that store general information include:
83
-
84
-
`src/WikiBot/ContentRep/Revision.java`
85
-
86
-
* This class stores information on page revisions.
87
-
88
-
`src/WikiBot/ContentRep/ImageInfo.java`
89
-
90
-
* This class stores information on images. This might or might not include: direct url, dimension, size, ect...
91
-
92
-
`src/WikiBot/ContentRep/PageLocation.java`
93
-
94
-
* This class stores information on how to find a page. Spefically, it contains the page title and wiki.
0 commit comments