wikidata-diff-analyzer 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wikidata/diff/api.rb +3 -7
- data/lib/wikidata-diff-analyzer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a1507e2a77b9de58d49cbc039cd11b6f8f51f519ed246742b7f137a58b3f47a
|
4
|
+
data.tar.gz: 313bf47cd9b3256f554e96db727488e4d8a96cd695286ed75627e14c26abd3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 473b2c0ce9eb12e645a20a29ab5c51a194932836520c756b95021a85fbeb43e39aa29c8973c7e23c564ef005497480d16eec5a7c908c32b90bdebb9e29e2a847
|
7
|
+
data.tar.gz: 372d2231ad60164469ab0fc0ca21c4987129127d28a260bdcb0e9466db55dc0623a09503da0e2f152adef9e092038d2ca7806f86dd540867af2463d3a28e17a3
|
data/lib/wikidata/diff/api.rb
CHANGED
@@ -7,8 +7,6 @@ class Api
|
|
7
7
|
client = MediawikiApi::Client.new(api_url)
|
8
8
|
|
9
9
|
# remove duplicates if revision_ids exists
|
10
|
-
# check if duplicate revision_ids exist and print if exists
|
11
|
-
|
12
10
|
revision_ids = revision_ids.uniq if revision_ids
|
13
11
|
|
14
12
|
begin
|
@@ -40,13 +38,13 @@ class Api
|
|
40
38
|
content_model = revision['slots']['main']['contentmodel']
|
41
39
|
if content_model == 'wikibase-item' || content_model == 'wikibase-property' || content_model == 'wikibase-lexeme'
|
42
40
|
if revision.key?('texthidden')
|
43
|
-
|
41
|
+
# "Content has been hidden or deleted"
|
44
42
|
revid = revision['revid']
|
45
43
|
parentid = revision['parentid']
|
46
44
|
parsed_contents[revid] = { content: nil, comment: nil, parentid: parentid, model: content_model }
|
47
45
|
# checking if comment has been deleted
|
48
46
|
elsif revision.key?('commenthidden')
|
49
|
-
|
47
|
+
# "Comment has been hidden or deleted"
|
50
48
|
revid = revision['revid']
|
51
49
|
content = revision['slots']['main']['*']
|
52
50
|
parentid = revision['parentid']
|
@@ -62,9 +60,7 @@ class Api
|
|
62
60
|
parsed_contents[revid] = { content: JSON.parse(content), comment: comment, parentid: parentid, model: content_model}
|
63
61
|
end
|
64
62
|
end
|
65
|
-
|
66
|
-
puts "Content model is #{content_model}"
|
67
|
-
puts "Revision id is #{revision['revid']}"
|
63
|
+
# in the other cases, the content model is wikitext, so we won't be handling those
|
68
64
|
end
|
69
65
|
end
|
70
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikidata-diff-analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sulagna Saha
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|