Class: FacebookBot
- Inherits:
-
Object
- Object
- FacebookBot
- 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
-
.cookie_path ⇒ Object
Returns the value of attribute cookie_path.
-
.email ⇒ Object
Returns the value of attribute email.
-
.password ⇒ Object
Returns the value of attribute password.
Instance Method Summary collapse
-
#initialize ⇒ FacebookBot
constructor
A new instance of FacebookBot.
- #video_name(id) ⇒ Object
- #video_url(id) ⇒ Object
Constructor Details
#initialize ⇒ FacebookBot
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
.cookie_path ⇒ Object
Returns the value of attribute cookie_path.
27 28 29 |
# File 'lib/facebook_bot.rb', line 27 def @cookie_path end |
.email ⇒ Object
Returns the value of attribute email.
25 26 27 |
# File 'lib/facebook_bot.rb', line 25 def email @email end |
.password ⇒ Object
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 |