Class: Fbapp::Drivers::Celerity
- Inherits:
-
Base
- Object
- Base
- Fbapp::Drivers::Celerity
show all
- Defined in:
- lib/fbapp/drivers/celerity.rb
Instance Method Summary
collapse
Methods inherited from Base
#get_or_cache_credentials
Instance Method Details
#browser ⇒ Object
27
28
29
|
# File 'lib/fbapp/drivers/celerity.rb', line 27
def browser
@browser ||= ::Celerity::Browser.new
end
|
#list ⇒ Object
6
7
8
9
10
|
# File 'lib/fbapp/drivers/celerity.rb', line 6
def list
login
browser.goto("http://www.facebook.com/developers/apps.php")
puts browser.div(:id, "dev_app_list").text
end
|
#login ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/fbapp/drivers/celerity.rb', line 31
def login
email, pass = get_or_cache_credentials
browser.goto("http://www.facebook.com")
browser.text_field(:name, "email").value = email
browser.text_field(:name, "pass").value = pass
browser.button(:value, "Login").click
end
|
#show(app) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/fbapp/drivers/celerity.rb', line 12
def show(app)
login
browser.goto("http://www.facebook.com/developers/apps.php")
lnk = browser.div(:id, "dev_app_list").links.find { |l| l.text == app }
lnk.click
id = lnk.parent.id.split("_").first
dl = browser.div(:id, "#{id}_info").div(:class, "dev_application_info").dl
titles, values = dl.dts, dl.dds
titles.zip(values).each do |k, v|
puts "#{k.text.ljust(19)} : #{v.text}"
end
end
|