wikian 0.1.7 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/wikian.rb +19 -17
- data/lib/wikian/contributions.rb +2 -3
- data/lib/wikian/get.rb +1 -0
- data/lib/wikian/search.rb +1 -1
- data/lib/wikian/subcommand.rb +1 -3
- data/lib/wikian/version.rb +1 -1
- data/wikian.gemspec +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dac3dedbc9c20098849e966beda97855a9a133d8b9334ad26d5a2a651ce18fa2
|
4
|
+
data.tar.gz: 347b7ead2d39dee453f122757f1cfb758559eb86e30ec924e55a6aca48101e4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 518a100775e95f60f37925142dafea7614298c654ff5a87f5358966dc7e40c25a3551f06c547dac971d81bf3589100967815104ee4fc3d6e239788a87553b8b0
|
7
|
+
data.tar.gz: a0230996611e118bb272dfdc83c8ef424bf180fb7b5fd51057f6ceee8a24e3ffe931493ce1b11ee77668d38c131346020d7e8342cd544c64147782d8e41d1c9d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Wikian
|
2
2
|
|
3
3
|
Want to be a happier [Wikipedian](https://en.wikipedia.org/wiki/Wikipedia:Wikipedians)?
|
4
|
-
|
4
|
+
Then you want [Wikian](https://rubygems.org/gems/wikian), which lets you edit Wikipedia pages locally, with your favorite text editor.
|
5
5
|
To install it:
|
6
6
|
|
7
7
|
```
|
@@ -56,7 +56,7 @@ Writing to Wikipedia:Sandbox.en.wikipedia.org.json
|
|
56
56
|
Writing to Wikipedia:Sandbox.en.wikipedia.org.wiki
|
57
57
|
```
|
58
58
|
|
59
|
-
Then edit the
|
59
|
+
Then edit the article and upload it:
|
60
60
|
|
61
61
|
```bash
|
62
62
|
$ wi post Wikipedia:Sandbox.en.wikipedia.org.wiki
|
@@ -80,7 +80,7 @@ $ wi s
|
|
80
80
|
Writing to Mr. Fixit.json
|
81
81
|
```
|
82
82
|
|
83
|
-
To get your last 10
|
83
|
+
To get your last 10 Wikipedia contributions:
|
84
84
|
|
85
85
|
```
|
86
86
|
$ wi c -t
|
@@ -90,4 +90,4 @@ $ wi c
|
|
90
90
|
Writing to User:Example_User.contributions.en.wikipedia.org.json
|
91
91
|
```
|
92
92
|
|
93
|
-
Vim users should try
|
93
|
+
Vim users should try [mediawiki.vim](https://en.wikipedia.org/wiki/Help:Text_editor_support#Vim) which adds syntax highlighting and abbreviations for wikitext files.
|
data/lib/wikian.rb
CHANGED
@@ -66,46 +66,48 @@ class Wikian
|
|
66
66
|
Options:
|
67
67
|
-a, --append append the input file
|
68
68
|
-c, --captcha ID:MESSAGE captcha info
|
69
|
-
-d, --debug
|
69
|
+
-d, --debug print debugging messages
|
70
|
+
-h, --help print this help message
|
70
71
|
-m, --message MESSAGE add a commit message (HIGHLY recommended)
|
71
72
|
-p, --prepend prepend the input file
|
72
73
|
-r, --remove-cookie remove API cookie
|
73
74
|
-s, --section NUMBER section to edit
|
74
75
|
-t, --template create template configuration file
|
75
|
-
-v, --version
|
76
|
+
-v, --version print version number
|
76
77
|
|
77
78
|
Subcommands:
|
78
79
|
c, contributions [N] get user last N contributions. N defaults to 20
|
79
|
-
g, get get wikitext
|
80
|
-
p, post post wikitext
|
81
|
-
s, search search wikitext
|
80
|
+
g, get get wikitext from a Wikipedia article
|
81
|
+
p, post post wikitext to a Wikipedia article
|
82
|
+
s, search search wikitext in Wikipedia
|
82
83
|
|
83
84
|
Examples:
|
84
85
|
# create wiki.yml template
|
85
|
-
|
86
|
+
wi g -t
|
86
87
|
|
87
|
-
# download article
|
88
|
-
|
88
|
+
# download article
|
89
|
+
wi get -t
|
90
|
+
wi get https://en.wikipedia.org/wiki/Wikipedia:Sandbox
|
89
91
|
|
90
|
-
# upload file
|
91
|
-
|
92
|
+
# upload file
|
93
|
+
wi post Wikipedia:Sandbox.en.wikipedia.org.wiki
|
92
94
|
|
93
95
|
# upload file to Spanish Wikipedia
|
94
|
-
|
96
|
+
wi post Wikipedia:Sandbox.es.wikipedia.org.wiki
|
95
97
|
|
96
98
|
# upload file to English Wiktionary
|
97
|
-
|
99
|
+
wi post Wikipedia:Sandbox.en.wiktionary.org.wiki
|
98
100
|
|
99
|
-
# append
|
100
|
-
|
101
|
+
# append wikitext to section 2 of the article
|
102
|
+
wi post -a -s 2 Wikipedia:Sandbox.en.wikipedia.org.wiki
|
101
103
|
|
102
104
|
# heavy use of the API may require cache validation
|
103
|
-
|
105
|
+
wi post -c 1234:someMessage spider-Man.wiki
|
104
106
|
|
105
107
|
Comments:
|
106
108
|
Posted files must follow the convention:
|
107
|
-
<article_name>.<
|
108
|
-
where <
|
109
|
+
<article_name>.<site>.wiki
|
110
|
+
where <site> is a wikimedia site.
|
109
111
|
More info at: https://meta.wikimedia.org/wiki/Our_projects
|
110
112
|
eos
|
111
113
|
exit
|
data/lib/wikian/contributions.rb
CHANGED
@@ -27,12 +27,11 @@ class Wikian
|
|
27
27
|
|
28
28
|
def template
|
29
29
|
<<~eos
|
30
|
+
# for a list of parameters to use here see: https://www.mediawiki.org/wiki/API:Usercontribs
|
30
31
|
meta:
|
31
|
-
http_method: get
|
32
32
|
site: en.wikipedia.org
|
33
33
|
headers:
|
34
|
-
|
35
|
-
user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
|
34
|
+
user-agent: Wikian
|
36
35
|
api:
|
37
36
|
action:
|
38
37
|
- query
|
data/lib/wikian/get.rb
CHANGED
data/lib/wikian/search.rb
CHANGED
data/lib/wikian/subcommand.rb
CHANGED
data/lib/wikian/version.rb
CHANGED
data/wikian.gemspec
CHANGED
@@ -6,9 +6,9 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.authors = ["sergioro"]
|
7
7
|
spec.email = ["yo@sergioro.com"]
|
8
8
|
|
9
|
-
spec.summary = %q{Get and
|
10
|
-
spec.description = %q{Get and
|
11
|
-
|
9
|
+
spec.summary = %q{Get and update Wikipedia articles}
|
10
|
+
spec.description = %q{Get and update Wikipedia articles}
|
11
|
+
spec.homepage = "https://sergioro.mx/posts/wikian"
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
14
|
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sergioro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Get and
|
13
|
+
description: Get and update Wikipedia articles
|
14
14
|
email:
|
15
15
|
- yo@sergioro.com
|
16
16
|
executables:
|
@@ -40,7 +40,7 @@ files:
|
|
40
40
|
- lib/wikian/subcommand.rb
|
41
41
|
- lib/wikian/version.rb
|
42
42
|
- wikian.gemspec
|
43
|
-
homepage:
|
43
|
+
homepage: https://sergioro.mx/posts/wikian
|
44
44
|
licenses:
|
45
45
|
- MIT
|
46
46
|
metadata: {}
|
@@ -62,5 +62,5 @@ requirements: []
|
|
62
62
|
rubygems_version: 3.1.4
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
|
-
summary: Get and
|
65
|
+
summary: Get and update Wikipedia articles
|
66
66
|
test_files: []
|