sqlite.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. module Docs
  2. class Sqlite < FileScraper
  3. self.name = 'SQLite'
  4. self.type = 'sqlite'
  5. self.release = '3.25.2'
  6. self.base_url = 'https://sqlite.org/'
  7. self.root_path = 'docs.html'
  8. self.initial_paths = %w(keyword_index.html)
  9. self.links = {
  10. home: 'https://sqlite.org/',
  11. code: 'https://www.sqlite.org/src/'
  12. }
  13. html_filters.insert_before 'clean_html', 'sqlite/clean_js_tables'
  14. html_filters.push 'sqlite/entries', 'sqlite/clean_html'
  15. options[:only_patterns] = [/\.html\z/]
  16. options[:skip_patterns] = [/releaselog/, /consortium/]
  17. options[:skip] = %w(
  18. index.html
  19. about.html
  20. download.html
  21. copyright.html
  22. support.html
  23. prosupport.html
  24. hp1.html
  25. news.html
  26. oldnews.html
  27. doclist.html
  28. dev.html
  29. chronology.html
  30. not-found.html
  31. famous.html
  32. books.html
  33. crew.html
  34. mostdeployed.html
  35. requirements.html
  36. session/intro.html
  37. syntax.html
  38. )
  39. options[:attribution] = 'SQLite is in the Public Domain.'
  40. private
  41. def parse(response)
  42. response.body.gsub! %r{(<h2[^>]*>[^<]+)</h1>}, '\1</h2>'
  43. super
  44. end
  45. end
  46. end