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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4365188a029e7d0d76f906b95ed64da8c5a8e6bdca0f31aa7b6fabde41d228be
4
- data.tar.gz: 464993485465534f4d43fc7162d224780ed11ccf40bad13c0d66dda6e3de0b14
3
+ metadata.gz: dac3dedbc9c20098849e966beda97855a9a133d8b9334ad26d5a2a651ce18fa2
4
+ data.tar.gz: 347b7ead2d39dee453f122757f1cfb758559eb86e30ec924e55a6aca48101e4f
5
5
  SHA512:
6
- metadata.gz: 8b7393793bb7f0c62d1e1a3910a1a99e39c7abd4e0e2374eaf7e376f2cbc125734543feb3a16cda505668b7cb09dd90d35903c87367293d82afc9c408d9768d6
7
- data.tar.gz: 3c2ccd2cb6a1b753175a9b0a9bd0b545ea6ea3346418a17bd555df28e9bce88b4c236fab0a800018a9839c0a3e76c21abcff3e62acfdfd140c043e2b6cbb91bd
6
+ metadata.gz: 518a100775e95f60f37925142dafea7614298c654ff5a87f5358966dc7e40c25a3551f06c547dac971d81bf3589100967815104ee4fc3d6e239788a87553b8b0
7
+ data.tar.gz: a0230996611e118bb272dfdc83c8ef424bf180fb7b5fd51057f6ceee8a24e3ffe931493ce1b11ee77668d38c131346020d7e8342cd544c64147782d8e41d1c9d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wikian (0.1.7)
4
+ wikian (0.1.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
- Me too, that's why I use [Wikian](https://rubygems.org/gems/wikian) which lets me edit wikipedia pages locally, with my favorite text editor.
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 the article in your favorite text editor and upload it:
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 wikipedia contributions:
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 out [mediawiki.vim](https://en.wikipedia.org/wiki/Help:Text_editor_support#Vim) which defines syntax highlighting and abbreviations for wikitext files.
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.
@@ -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 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 file from a wikipedia article
80
- p, post post wikitext file to a wikipedia article
81
- s, search search wikitext file to a wikipedia article
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
- wiki -t
86
+ wi g -t
86
87
 
87
- # download article and create response and wikitext files
88
- wiki get https://en.wikipedia.org/wiki/Spider-Man
88
+ # download article
89
+ wi get -t
90
+ wi get https://en.wikipedia.org/wiki/Wikipedia:Sandbox
89
91
 
90
- # upload file to English Wikipedia
91
- wiki post Spider-Man.en.wikipedia.org.wiki
92
+ # upload file
93
+ wi post Wikipedia:Sandbox.en.wikipedia.org.wiki
92
94
 
93
95
  # upload file to Spanish Wikipedia
94
- wiki post Spider-Man.es.wikipedia.org.wiki
96
+ wi post Wikipedia:Sandbox.es.wikipedia.org.wiki
95
97
 
96
98
  # upload file to English Wiktionary
97
- wiki file to Spider-Man.es.wiktionary.org.wiki
99
+ wi post Wikipedia:Sandbox.en.wiktionary.org.wiki
98
100
 
99
- # append new section to article
100
- wiki post -a Spider-Man-new-section.wiki
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
- wiki post -c 1234:someMessage spider-Man.wiki
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>.<host>.wiki
108
- where <host> is a wikimedia site.
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
@@ -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
- #accept-encoding: gzip
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
@@ -72,6 +72,7 @@ class Wikian
72
72
 
73
73
  def template
74
74
  <<~eos
75
+ # for a list of parameters to use here see: https://www.mediawiki.org/wiki/API:Get_the_contents_of_a_page
75
76
  meta:
76
77
  headers:
77
78
  user-agent: Wikian
@@ -20,7 +20,7 @@ class Wikian
20
20
 
21
21
  def template
22
22
  <<~eos
23
- # Get last 5 revisions of the Main Page.
23
+ # for a list of parameters to use here see: https://www.mediawiki.org/wiki/API:Search
24
24
  meta:
25
25
  site: en.wikipedia.org
26
26
  headers:
@@ -36,9 +36,7 @@ class Wikian
36
36
  (puts 'Bye'; exit) if answer != 'y'
37
37
  end
38
38
 
39
- File.open(CONFIG_FILE, 'w') do |f|
40
- f.write template
41
- end
39
+ File.write(CONFIG_FILE, template)
42
40
  exit
43
41
  end
44
42
 
@@ -1,3 +1,3 @@
1
1
  class Wikian
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.12"
3
3
  end
@@ -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 edit wikipedia articles}
10
- spec.description = %q{Get and edit wikipedia articles}
11
- #spec.homepage = "TODO: Put your gem's website or public repo URL here."
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.7
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 00:00:00.000000000 Z
11
+ date: 2020-09-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Get and edit wikipedia articles
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 edit wikipedia articles
65
+ summary: Get and update Wikipedia articles
66
66
  test_files: []