class Object

Public Instance Methods

find_assets(source) click to toggle source
# File lib/neekkue_set_assets.rb, line 9
def find_assets(source)
  i = 0
  loop do
    i += 1
    st = source.index('<tr') + 5
    source = source[st, source.length]
    break if i == 3
  end
  ed = source.index('<td style=') - 1
  source = source[1, ed]

  times = source.split('</').size
  i = 0
  loop do
    i += 1
    st = source.index('<td') + 5
    source = source[st, source.length]
    break if i == times - 1
  end
  ed = source.index('&')
  source[0, ed]
end
find_first_tag(source, tag) click to toggle source
# File lib/neekkue_set_assets.rb, line 3
def find_first_tag(source, tag)
  st = source.index("<#{tag}") + 2 + tag.length
  ed = source.index("</#{tag}")
  source[st, ed - st]
end
find_first_url(source) click to toggle source
# File lib/neekkue_set_assets.rb, line 41
def find_first_url(source)
  st = source.index('?') + 1
  ed = source.index('" target=""')
  iden = source[st, ed - st]
  'https://www.set.or.th/set/companyhighlight.do?'.to_s + iden
end
print_all() click to toggle source
print_company(url) click to toggle source
remove_top(source, top, bottom) click to toggle source
# File lib/neekkue_set_assets.rb, line 48
def remove_top(source, top, bottom)
  st = source.index(top) + top.length
  ed = source.index(bottom) + bottom.length
  source[st, ed - st]
end