Merge pull request #2015 from ClasherKasten/fix/github-scraper

pull/2020/head
Simon Legner 2 years ago committed by GitHub
commit dd75c13af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,5 +4,20 @@ module Docs
self.type = 'github'
html_filters.push 'github/clean_html'
def process_response?(response)
if super(response)
return true
end
JSON.parse(response.body)
true
rescue JSON::ParserError, TypeError => e
false
end
def parse(response)
parsed = JSON.parse(response.response_body)
[parsed['payload']['blob']['richText'], parsed['title']]
end
end
end

Loading…
Cancel
Save