Sha256: b4aaebc5771b4bb194766b81aded53bb68ab1c36d4199b33fcaccc4ceb712d4f
Contents?: true
Size: 535 Bytes
Versions: 9
Compression:
Stored size: 535 Bytes
Contents
require 'active_interaction' require 'net/http' require 'oga' module MercadolibreApi module Products module Queries class SoldQuantity < ActiveInteraction::Base string :product_url def execute response = Net::HTTP.get(product_uri).force_encoding('UTF-8') document = Oga.parse_html(response) document.at_css('.item-conditions').text.scan(/\d+/).join.to_i end private def product_uri URI(product_url) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems