Class: Hawker::Drivers::Github
- Defined in:
- lib/hawker/drivers/github.rb
Instance Method Summary collapse
-
#company ⇒ String
The current user company.
-
#followers ⇒ Integer
The count of users following the current user.
-
#following ⇒ Integer
The count of users that the current user is following.
-
#location ⇒ String
The current user location.
-
#name ⇒ String
The current user full name.
-
#repositories ⇒ Integer
The count of repositiories owned by the current user.
-
#stars ⇒ Integer
The count of stars that the current user gave.
-
#username ⇒ String
The current user nickname.
-
#website ⇒ String
The current user website.
Methods inherited from Default
Constructor Details
This class inherits a constructor from Hawker::Drivers::Default
Instance Method Details
#company ⇒ String
The current user company
22 23 24 |
# File 'lib/hawker/drivers/github.rb', line 22 def company node_text html.at("li[itemprop='worksFor'] div") end |
#followers ⇒ Integer
The count of users following the current user
58 59 60 |
# File 'lib/hawker/drivers/github.rb', line 58 def followers node_text(html.at("a[title='Followers'] span.Counter")).to_i end |
#following ⇒ Integer
The count of users that the current user is following
65 66 67 |
# File 'lib/hawker/drivers/github.rb', line 65 def following node_text(html.at("a[title='Following'] span.Counter")).to_i end |
#location ⇒ String
The current user location
29 30 31 |
# File 'lib/hawker/drivers/github.rb', line 29 def location node_text html.at("li[itemprop='homeLocation'] span") end |
#name ⇒ String
The current user full name
8 9 10 |
# File 'lib/hawker/drivers/github.rb', line 8 def name node_text html.at("h1.vcard-names span.vcard-fullname[itemprop='name']") end |
#repositories ⇒ Integer
The count of repositiories owned by the current user
44 45 46 |
# File 'lib/hawker/drivers/github.rb', line 44 def repositories node_text(html.at("a[title='Repositories'] span.Counter")).to_i end |
#stars ⇒ Integer
The count of stars that the current user gave
51 52 53 |
# File 'lib/hawker/drivers/github.rb', line 51 def stars node_text(html.at("a[title='Stars'] span.Counter")).to_i end |
#username ⇒ String
The current user nickname
15 16 17 |
# File 'lib/hawker/drivers/github.rb', line 15 def username node_text html.at("h1.vcard-names span.vcard-username[itemprop='additionalName']") end |
#website ⇒ String
The current user website
36 37 38 39 |
# File 'lib/hawker/drivers/github.rb', line 36 def website node = html.at("li[itemprop='url'] a") node[:href] unless node.nil? end |