Class: FacebookBot

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook_bot.rb

Defined Under Namespace

Classes: CookiePathNotInitialized, LoginFailed

Constant Summary collapse

FB_URL =
"http://www.facebook.com/"
USER_AGENT =
'Windows IE 7'
VIDEO_ERROR =
'video_id_error'

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFacebookBot

Returns a new instance of FacebookBot.



35
36
37
38
39
# File 'lib/facebook_bot.rb', line 35

def initialize
  @video_page = nil
  @agent = Mechanize.new
  @agent.user_agent_alias = USER_AGENT
end

Class Attribute Details

Returns the value of attribute cookie_path.



27
28
29
# File 'lib/facebook_bot.rb', line 27

def cookie_path
  @cookie_path
end

.emailObject

Returns the value of attribute email.



25
26
27
# File 'lib/facebook_bot.rb', line 25

def email
  @email
end

.passwordObject

Returns the value of attribute password.



26
27
28
# File 'lib/facebook_bot.rb', line 26

def password
  @password
end

Instance Method Details

#video_name(id) ⇒ Object



48
49
50
51
# File 'lib/facebook_bot.rb', line 48

def video_name(id)
  load_video_page(id)
  get_name(@video_page)
end

#video_url(id) ⇒ Object



41
42
43
44
45
46
# File 'lib/facebook_bot.rb', line 41

def video_url(id)
   load_video_page(id)
   get_url(@video_page)
 #rescue
 #  VIDEO_ERROR
end