Class: Geostats::Grabber::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/geostats/grabber/log.rb

Instance Method Summary collapse

Constructor Details

#initialize(uuid) ⇒ Log

Returns a new instance of Log.



4
5
6
# File 'lib/geostats/grabber/log.rb', line 4

def initialize(uuid)
  @resp, @data = HTTP.get("/seek/log.aspx?LUID=#{uuid}")
end

Instance Method Details

#iconObject



8
9
10
11
12
# File 'lib/geostats/grabber/log.rb', line 8

def icon
  if @data =~ /<img id="ctl00_ContentBody_LogBookPanel1_LogImage".*?src="\/images\/icons\/(.*?).gif" .*? \/>/
    $1
  end
end

#logged_atObject



20
21
22
23
24
# File 'lib/geostats/grabber/log.rb', line 20

def logged_at
  if @data =~ /<span id="ctl00_ContentBody_LogBookPanel1_LogDate">(.*?)<\/span>/
    Time.parse($1) rescue nil
  end
end

#messageObject



14
15
16
17
18
# File 'lib/geostats/grabber/log.rb', line 14

def message
  if @data =~ /<p><span id="ctl00_ContentBody_LogBookPanel1_LogText">(.*)<\/span><\/p>/
    Utils.replace_smilie_img_tags(Utils.unescape($1))
  end
end