Fua
In many Ruby script such as crawlers,you need to change your User-Agent. It can be done by fua so easy and fast. It returns selected real device User Agent string and keep your script away from nested User Agent string.
It supports:
::
Smartphones :
Android(Browser,Firefox,WebView,Chrome,Opera)
iOS(Saffari,Firefox,Chrome)
Windows Phone(Browser)
Blackberry(Browser)
Palm(Blazer)
Fennec(Browser)
Symbian(Browser,Go_Browser,Opera_Mini,Opera)
Maemo(Browser,Firefox)
Motorola(MIB)
FirefoxOS(Browser)
Samsung(Tizen)
----
Desktop :
Windows(IE,Edge,Firefox,Chrome,Opera,Saffari,SeaMonkey)
macOS(Saffari,Firefox,Opera,Chrome,Camino,SeaMonkey)
Google Chrome(Chrome,Firefox)
FreeBSD(Chrome,Opera,Firefox)
Linux(Chrome,Opera,Firefox,SeaMonkey)
Unix(Chrome,Surf,Opera)
---
Wearable :
Google Glass
---
Smart TV :
Samsung(Browser,HBB,SmartHub)
Sharp
Sony
Technisat
VIZIO
Toshiba
Philips
Roku
tvOS
LG(Netcast)
Google TV
Mapple Browser
HBB TV
Google ChromeCast
Netgear
Panasonic
---
Game Consoles :
Xbox One
Playstation4
Installation
Add this line to your application's Gemfile:
gem 'fua'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fua
Usage
require 'fua'
android_chrome_ua = Fua::SmartPhone::Android.new.Chrome
xboxOne_ua = Fua::Game_Consoles.new.Xbox_One
win_ie_ua = Fua::Desktop::Windows.new.IE
And then use your User Agent string in your header of your requests.
Development
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/behdadahmadi/fua. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.