sunflower 0.5.11 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/example-bot.rb +1 -1
- data/lib/sunflower/core.rb +3 -3
- metadata +15 -22
- data/README +0 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c409437f8526db32f7aab67a939cfb3df8d5a8c8
|
4
|
+
data.tar.gz: 71735430b60c4ca4c745beeb2125e0a277b81a1d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9e34e6752bb4aafe84fd4307ba12f355f866ca6c56b7aefbd34d40c5ffc4e5f6ed47af708fd0f64d2d30a52dadc532e107b6a4b8763143691d1f74d1f4dc7bf8
|
7
|
+
data.tar.gz: abc9031eadbc2e58dc5559adf0a3afbb1e8c3cd07aa78d15321fecfa7d7c691e2fae42d99c38cb746dba9b63d5fbb82faaea1a7c59c2aa46ba786adcdeb7ea87
|
data/example-bot.rb
CHANGED
data/lib/sunflower/core.rb
CHANGED
@@ -40,7 +40,7 @@ end
|
|
40
40
|
#
|
41
41
|
# You can use multiple Sunflowers at once, to work on multiple wikis.
|
42
42
|
class Sunflower
|
43
|
-
VERSION = '0.5.
|
43
|
+
VERSION = '0.5.12'
|
44
44
|
|
45
45
|
INVALID_CHARS = %w(# < > [ ] | { })
|
46
46
|
INVALID_CHARS_REGEX = Regexp.union *INVALID_CHARS
|
@@ -164,7 +164,7 @@ class Sunflower
|
|
164
164
|
else
|
165
165
|
# probably a Wikimedia wiki shorthand
|
166
166
|
@wikiURL = Sunflower.resolve_wikimedia_id(url)
|
167
|
-
@api_endpoint = opts[:api_endpoint] || '
|
167
|
+
@api_endpoint = opts[:api_endpoint] || 'https://'+@wikiURL+'/w/api.php'
|
168
168
|
end
|
169
169
|
|
170
170
|
# handle protocol-relative URLs
|
@@ -308,7 +308,7 @@ class Sunflower
|
|
308
308
|
# 2. actually log in
|
309
309
|
response = RestClient.post(
|
310
310
|
@api_endpoint,
|
311
|
-
"action=login&lgname=#{CGI.escape user}&lgpassword=#{CGI.escape password}&lgtoken=#{token}&format=json",
|
311
|
+
"action=login&lgname=#{CGI.escape user}&lgpassword=#{CGI.escape password}&lgtoken=#{CGI.escape token}&format=json",
|
312
312
|
{:user_agent => "Sunflower #{VERSION} alpha", :cookies => @cookies}
|
313
313
|
)
|
314
314
|
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunflower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.12
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Matma Rex
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-05-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: json
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rest-client
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Sunflower is a lightweight library to provide access to MediaWiki API
|
@@ -51,7 +46,6 @@ executables:
|
|
51
46
|
extensions: []
|
52
47
|
extra_rdoc_files: []
|
53
48
|
files:
|
54
|
-
- README
|
55
49
|
- LICENSE
|
56
50
|
- bin/sunflower-setup
|
57
51
|
- example-bot.rb
|
@@ -66,29 +60,28 @@ files:
|
|
66
60
|
- scripts/fix-double-pipes.rb
|
67
61
|
- scripts/fix-some-entities.rb
|
68
62
|
- scripts/recat.rb
|
69
|
-
homepage:
|
70
|
-
licenses:
|
63
|
+
homepage: https://github.com/MatmaRex/Sunflower
|
64
|
+
licenses:
|
65
|
+
- CC-BY-SA-3.0
|
66
|
+
metadata: {}
|
71
67
|
post_install_message:
|
72
68
|
rdoc_options: []
|
73
69
|
require_paths:
|
74
70
|
- lib
|
75
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
72
|
requirements:
|
78
|
-
- -
|
73
|
+
- - '>='
|
79
74
|
- !ruby/object:Gem::Version
|
80
75
|
version: '0'
|
81
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
77
|
requirements:
|
84
|
-
- -
|
78
|
+
- - '>='
|
85
79
|
- !ruby/object:Gem::Version
|
86
80
|
version: '0'
|
87
81
|
requirements: []
|
88
82
|
rubyforge_project:
|
89
|
-
rubygems_version:
|
83
|
+
rubygems_version: 2.0.15
|
90
84
|
signing_key:
|
91
|
-
specification_version:
|
92
|
-
summary:
|
93
|
-
Ruby.
|
85
|
+
specification_version: 4
|
86
|
+
summary: Lightweight library to provide MediaWiki API access
|
94
87
|
test_files: []
|
data/README
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
Version: 0.5.11 alpha
|
2
|
-
|
3
|
-
>>> English:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
>>> Polski:
|
8
|
-
|
9
|
-
==============================
|
10
|
-
Nie edytuj żadnych plików .rb Notatnikiem - na początku plików zapisanych w Unikodzie dodaje on tzw. BOM, który powoduje wywalanie się Rubiego. Edytuj jest WordPadem lub, najlepiej, jakimś edytorem z kolorowaniem składni (np. Notepad++).
|
11
|
-
==============================
|
12
|
-
Aby bot zawsze automatycznie się logował bez konieczności podawania hasła w pliku .rb, utwórz plik o nazwie "userdata" (bez rozszerzenia) i w treści wpisz (oddzielając enterem) kolejno URL do wiki, login i hasło. Wtedy Sunflower.new() i s.login() można wywoływać bez parametrów - z pustymi nawiasami.
|
13
|
-
==============================
|
14
|
-
|
15
|
-
sunflower-core.rb to podstawowy plik z ramą bota. sunflower-commontasks.rb zawiera parę funkcji, które ułatwiający wykonywanie różnych zadań.
|
16
|
-
|
17
|
-
example-bot.rb to przykład bota; jest to niemal najkrótszy kod, który cokolwiek może zrobić, ten pobiera stronę, dodaje do niej "test" i zapisuje ją.
|
18
|
-
|
19
|
-
use-easy-bot.rb to skrypt pozwalający w zamierzeniu na uzycie bota laikom. Pobiera listę stron z pliku (należy ją stworzyć np. AWB i zapisać jako "Plaintext list" - tytuły stron oddzielone enterami), po czym w każdej wykonuje określone zmiany i zapisuje. Dokładniejszy opis jest w samym pliku, pamiętaj też, żeby zmienić oznaczone fragmenty. Komentarze zaczynają się od znaku "#".
|
20
|
-
|
21
|
-
W /scripts jest parę moich skryptów, niektóre moga się przydać, niektóre nie albo w ogóle nie działają.
|