Sha256: c6e60e209f9d4d2c29a900dcc24d83230a03e1d3e205612a6eab06adca8925d6

Contents?: true

Size: 457 Bytes

Versions: 1

Compression:

Stored size: 457 Bytes

Contents

require "uri"
require "open-uri"
require "nokogiri"

module NnmClub
  class Torrent
    def self.find(torrent_id)
      document = Nokogiri::HTML(open(NnmClub::TorrentURL+torrent_id))
      postbody = document.css('.postbody').first
      info = {:content  => postbody.to_html( encoding: "UTF-8" ),
              :image    => postbody.css('var.postImg').empty? ? "nil" : postbody.css('var.postImg').first['title']
      }
      return info
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nnmClub_api-0.1.2 lib/nnmClub_api/torrent.rb