def get_info
      return 'good.url.error' if !@url_info

      response = @conn.get @url_info[:url]

      doc = Nokogiri::HTML(response.body) 
      doc.encoding = 'utf-8'

      #处理标题
      begin
        title = title_filter(doc.css('title').first.text)
      rescue NoMethodError
        return 'good.not.exists'
      end

      #处理价格
      price_info = get_price(@url_info[:id])
      if price_info
        price = price_info[:price]
        promo_price = price_info[:promo_price]
      else
        if @url_info[:url].include? 'tmall'
          price = price_filter(doc.css('.J_originalPrice').first.text.strip)
          promo_price = 0
        else 
          price = price_filter(doc.css('em.tb-rmb-num').first.text)
          promo_price = 0
        end 
      end
      
      #处理图片
      images = []
      doc.css('#J_UlThumb').first.css('img').each do |img|
        img = img.attr('data-src').to_s == '' ? img.attr('src') : img.attr('data-src')
        images << image_filter(img)
      end

      {:title => title,
        :price => price,
        :promo_price => promo_price,
        :images => images,
        :url => @url_info[:url]}
    end
def get_info
      return 'good.url.error' if !@url_info

      response = @conn.get @url_info[:url]

      doc = Nokogiri::HTML(response.body) 
      doc.encoding = 'utf-8'

      #处理标题
      begin
        title = title_filter(doc.css('title').first.text)
      rescue NoMethodError
        return 'good.not.exists'
      end

      #处理价格
      price_info = get_price(@url_info[:id])
      if price_info
        price = price_info[:price]
        promo_price = price_info[:promo_price]
      else
        if @url_info[:url].include? 'tmall'
          price = price_filter(doc.css('.J_originalPrice').first.text.strip)
          promo_price = 0
        else 
          price = price_filter(doc.css('em.tb-rmb-num').first.text)
          promo_price = 0
        end 
      end
      
      #处理图片
      images = []
      doc.css('#J_UlThumb').first.css('img').each do |img|
        img = img.attr('data-src').to_s == '' ? img.attr('src') : img.attr('data-src')
        images << image_filter(img)
      end

      {:title => title,
        :price => price,
        :promo_price => promo_price,
        :images => images,
        :url => @url_info[:url]}
    end
得到产品信息