class Hawker::Drivers::Twitter
Public Instance Methods
bio()
click to toggle source
The current user biography note
@return [String]
# File lib/hawker/drivers/twitter.rb, line 15 def bio node_text(html.at("p.ProfileHeaderCard-bio")) end
followers()
click to toggle source
The current user followers count
@return [Integer]
# File lib/hawker/drivers/twitter.rb, line 52 def followers node = html.at("li.ProfileNav-item--followers span.ProfileNav-value") node.nil? ? 0 : node["data-count"].to_i end
following()
click to toggle source
The count of accounts that the current user follows
@return [Integer]
# File lib/hawker/drivers/twitter.rb, line 60 def following node = html.at("li.ProfileNav-item--following span.ProfileNav-value") node.nil? ? 0 : node["data-count"].to_i end
joined()
click to toggle source
The current user account creation date
@return [String]
# File lib/hawker/drivers/twitter.rb, line 37 def joined html.at("span.ProfileHeaderCard-joinDateText")[:title] end
likes()
click to toggle source
The current user likes count
@return [Integer]
# File lib/hawker/drivers/twitter.rb, line 68 def likes node = html.at("li.ProfileNav-item.ProfileNav-item--favorites span.ProfileNav-value") node.nil? ? 0 : node["data-count"].to_i end
lists()
click to toggle source
The current user lists count
@return [Integer]
# File lib/hawker/drivers/twitter.rb, line 76 def lists node_text(html.at("li.ProfileNav-item.ProfileNav-item--lists span.ProfileNav-value")).to_i end
location()
click to toggle source
The current user location
@return [String]
# File lib/hawker/drivers/twitter.rb, line 22 def location node_text(html.at("span.ProfileHeaderCard-locationText")) end
name()
click to toggle source
The current user name
@return [String]
# File lib/hawker/drivers/twitter.rb, line 8 def name node_text(html.at("h1.ProfileHeaderCard-name a")) end
tweets()
click to toggle source
The current user tweets count
@return [Integer]
# File lib/hawker/drivers/twitter.rb, line 44 def tweets node = html.at("a[data-nav='tweets'] span.ProfileNav-value") node.nil? ? 0 : node["data-count"].to_i end
website()
click to toggle source
The current user website
@return [String]
# File lib/hawker/drivers/twitter.rb, line 29 def website node = html.at("span.ProfileHeaderCard-urlText a") node[:title] if !node.nil? end