Sha256: 068b83920b0d8662622c0caf834932ce418e5102b9c4ae31333e04976be9237e

Contents?: true

Size: 352 Bytes

Versions: 2

Compression:

Stored size: 352 Bytes

Contents

#!/usr/bin/env ruby

# $LOAD_PATH.unshift(File.expand_path("../../lib", "__FILE__"))

require 'nokogiri'

n = Nokogiri::HTML::parse STDIN.read

query = ARGV.select{ |o| o =~ /^\// }
options = ARGV - query

n.css(query.first).each do |element|
  if options.any?{|o| ["-t", "--text"].include?(o) }
    puts element.text
  else
    puts element
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xp-0.0.2 bin/xp
xp-0.0.1 bin/xp