-
Notifications
You must be signed in to change notification settings - Fork 926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve TeSS scraping #4479
Improve TeSS scraping #4479
Conversation
hexylena
commented
Nov 2, 2023
- adds version field
- improved educational roles
- separate out contributors
- remove redundant "Hands on for "X"' which is just excessive
- standardised draft status
_plugins/jekyll-jsonld.rb
Outdated
[] | ||
elsif material.key?('contributions') | ||
material['contributions'] | ||
.reject{|k| k== 'funding'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Layout/SpaceBeforeBlockBraces> reported by reviewdog 🐶
Space missing to the left of {.
.reject{|k| k== 'funding'} | |
.reject {|k| k== 'funding'} |
_plugins/jekyll-jsonld.rb
Outdated
[] | ||
elsif material.key?('contributions') | ||
material['contributions'] | ||
.reject{|k| k== 'funding'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Layout/SpaceInsideBlockBraces> reported by reviewdog 🐶
Space between { and | missing.
.reject{|k| k== 'funding'} | |
.reject{ |k| k== 'funding'} |
_plugins/jekyll-jsonld.rb
Outdated
[] | ||
elsif material.key?('contributions') | ||
material['contributions'] | ||
.reject{|k| k== 'funding'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Layout/SpaceAroundOperators> reported by reviewdog 🐶
Surrounding space missing for operator ==
.
.reject{|k| k== 'funding'} | |
.reject{|k| k == 'funding'} |
_plugins/jekyll-jsonld.rb
Outdated
[] | ||
elsif material.key?('contributions') | ||
material['contributions'] | ||
.reject{|k| k== 'funding'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Layout/SpaceInsideBlockBraces> reported by reviewdog 🐶
Space missing inside }.
.reject{|k| k== 'funding'} | |
.reject{|k| k== 'funding' } |
_plugins/jekyll-jsonld.rb
Outdated
elsif material.key?('contributions') | ||
material['contributions'] | ||
.reject{|k| k== 'funding'} | ||
.reject{|k| k== 'authorship'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Layout/SpaceBeforeBlockBraces> reported by reviewdog 🐶
Space missing to the left of {.
.reject{|k| k== 'authorship'} | |
.reject {|k| k== 'authorship'} |
_plugins/jekyll-jsonld.rb
Outdated
if material.key?('short_id') | ||
data['identifier'] = "https://gxy.io/GTN:#{material['short_id']}" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Style/IfUnlessModifier> reported by reviewdog 🐶
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
.
if material.key?('short_id') | |
data['identifier'] = "https://gxy.io/GTN:#{material['short_id']}" | |
end | |
data['identifier'] = "https://gxy.io/GTN:#{material['short_id']}" if material.key?('short_id') |
_plugins/jekyll-jsonld.rb
Outdated
data['name'] = material['title'] | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Style/IdenticalConditionalBranches> reported by reviewdog 🐶
Move data['name'] = material['title']
out of the conditional.
data['name'] = material['title'] | |
else | |
else |
_plugins/jekyll-jsonld.rb
Outdated
data['name'] = material['title'] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Style/IdenticalConditionalBranches> reported by reviewdog 🐶
Move data['name'] = material['title']
out of the conditional.
data['name'] = material['title'] | |
end | |
end |
_plugins/jekyll-jsonld.rb
Outdated
@@ -513,6 +547,13 @@ def to_jsonld(material, topic, site) | |||
data['author'] = authors | |||
end | |||
|
|||
# Add non-author contributors | |||
if material.key?('contributions') | |||
data['contributor'] = get_contributors(material).map { |x| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Style/BlockDelimiters> reported by reviewdog 🐶
Avoid using {...}
for multi-line blocks.
data['contributor'] = get_contributors(material).map { |x| | |
data['contributor'] = get_contributors(material).map do |x| |
bin/workflows-fetch.rb
Outdated
w['server'] = server | ||
w | ||
end | ||
rescue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [rubocop] <Style/RescueStandardError> reported by reviewdog 🐶
Avoid rescuing without specifying an error class.
rescue | |
rescue StandardError |
7e4438c
to
1fe4036
Compare
031062b
to
75842d9
Compare