File: download_tika_data.rb

package info (click to toggle)
ruby-marcel 1.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,300 kB
  • sloc: xml: 8,111; ruby: 638; makefile: 7; javascript: 3
file content (11 lines) | stat: -rwxr-xr-x 385 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env ruby
require 'net/http'
require 'uri'

url = URI("https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml")
data = Net::HTTP.get_response(url).tap(&:value).body

# Insert a comment indicating provenance
data.sub! /\A(?:<\?xml.+\?>\n)?/, "\\&<!-- Downloaded at #{Time.now.utc} from #{url} -->\n"

puts data