The Hawker gem is a web scraper which allows you to pull the basic information for given social media profile URL. No structure knowledge or API access required. Keep in mind that it's always better to use the API if possible.
gem install hawker
Currently, the gem supports Github, Twitter and Instagram. If you need the support for another social media provider, please feel free to open new issue or push your own code and prepare pull request.
The gem has built in matching mechanism so you can pass any link and it will automatically use the proper driver.
You can request the profile information using this code:
profile = Hawker.get("https://github.com/rubyhero")
profile.username # => "rubyhero"
Following attributes are available:
name
- The name of the requested userusername
- The username of the requested user - it's also visible in the URLcompany
- The company name of the requested user if availablelocation
- The location of the requested user if availablewebsite
- The website URL of the requested userrepositories
- The count of the requested user repositoriesstars
- The number of stars that the requested user gavefollowers
- The number of people that are following the requested userfollowing
- The number of people followed by the requested user
You can request the profile information using this code:
profile = Hawker.get("https://twitter.com/pdabrowski_k1")
profile.name # => "Paweł Dąbrowski"
Following attributes are available:
name
- The name of the requested userbio
- The biography note of the requested userlocation
- The location of the requested user if availablewebsite
- The website URL of the requested userjoined
- The account creation date for the requested usertweets
- The number of messages tweeted by the requested userfollowers
- The number of people that are following the requested userfollowing
- The number of people followed by the requested userlikes
- The number of likes that the requested user gavelists
- The number of lists created by the requested user
You can request the profile information using this code:
profile = Hawker.get("https://www.instagram.com/someprofile")
profile.full_name # => "Full name"
Following attributes are available:
biography
- The biography note of the requested userfollowers
- The number of people that are following the requested userfollowing
- The number of people followed by the requested userfull_name
- The full name of the requested userexternal_url
- The URL from the biography note of the requested userprofile_pic_url
- The URL of the requested profile pictureusername
- The username of the requested user
This gem was tested on the 2.5.0 version. If it's not working with older versions please add a new issue.
Copyright (c) 2018 Paweł Dąbrowski. See LICENSE for details.