class BBS2ch::Post
Attributes
be[RW]
body[RW]
email[RW]
id[RW]
name[RW]
time[RW]
title[RW]
Public Class Methods
new(name, email, time, id, be, body, title)
click to toggle source
# File lib/bbs2ch/post.rb, line 3 def initialize(name, email, time, id, be, body, title) @name = name @email = email @time = time @id = id @be = be @body = body @title = title end
Public Instance Methods
fc2()
click to toggle source
# File lib/bbs2ch/post.rb, line 25 def fc2 fix_ttp @body.scan(%r{ttp://video\.fc2\.com/a/content/[0-9a-zA-Z]+}) end
fix_ttp(urls)
click to toggle source
# File lib/bbs2ch/post.rb, line 29 def fix_ttp(urls) urls.map { |url| url.gsub(/^ttp/, 'http') } end
images()
click to toggle source
# File lib/bbs2ch/post.rb, line 13 def images fix_ttp @body.scan(%r{ttps?:.*\.(?:jpg|png|gif)}) end
videos()
click to toggle source
# File lib/bbs2ch/post.rb, line 17 def videos xvideos + fc2 end
xvideos()
click to toggle source
# File lib/bbs2ch/post.rb, line 21 def xvideos fix_ttp @body.scan(%r{ttp://(?:www|jp)\.xvideos\.com/video[0-9]+}) end