Module: Ronin::Web::UserAgents
- Defined in:
- lib/ronin/web/user_agents.rb,
lib/ronin/web/user_agents/chrome.rb,
lib/ronin/web/user_agents/firefox.rb,
lib/ronin/web/user_agents/version.rb,
lib/ronin/web/user_agents/data_dir.rb,
lib/ronin/web/user_agents/os/linux.rb,
lib/ronin/web/user_agents/os/mac_os.rb,
lib/ronin/web/user_agents/google_bot.rb,
lib/ronin/web/user_agents/os/android.rb,
lib/ronin/web/user_agents/os/windows.rb,
lib/ronin/web/user_agents/internet_archive.rb
Overview
Provides categories of common User-Agent
strings.
Example
Get a random User-Agent
string:
user_agent = Ronin::Web::UserAgents.random
# => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.230 Safari/537.36"
Get a random Chrome User-Agent
string:
user_agent = Ronin::Web::UserAgents.chrome.random
# => "Mozilla/5.0 (Linux; Android 5.1.1; Redmi Note 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4688.3 Mobile Safari/537.36"
Get a random Firefox User-Agent
string:
user_agent = Ronin::Web::UserAgents.firefox.random
# => "Mozilla/5.0 (Windows NT 6.1; rv:78.0.2) Gecko/20100101 Firefox/78.0.2"
Get a random GoogleBot
User-Agent
string:
user_agent = Ronin::Web::UserAgents.google_bot.random
# => "GoogleBot/2.1 (+http://www.google.com/bot.html)"
Defined Under Namespace
Modules: Chrome, Firefox, GoogleBot, InternetArchive, OS
Constant Summary collapse
- VERSION =
ronin-web-user_agents version
'0.1.0'
- DATA_DIR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Path to the
data/
directory. File.('../../../../data',__dir__)
Class Method Summary collapse
-
.chrome ⇒ Chrome
Google Chrome
User-Agent
strings. -
.firefox ⇒ Firefox
Firefox
User-Agent
strings. -
.google_bot ⇒ GoogleBot
GoogleBot
User-Agent
strings. -
.google_chrome ⇒ Chrome
Alias for UserAgents.chrome.
-
.random(&block) ⇒ String?
Returns a random Browser
User-Agent
string from one of the following:.
Class Method Details
.chrome ⇒ Chrome
Google Chrome User-Agent
strings.
70 71 72 |
# File 'lib/ronin/web/user_agents.rb', line 70 def self.chrome Chrome end |
.firefox ⇒ Firefox
Firefox User-Agent
strings.
98 99 100 |
# File 'lib/ronin/web/user_agents.rb', line 98 def self.firefox Firefox end |
.google_bot ⇒ GoogleBot
GoogleBot
User-Agent
strings.
113 114 115 |
# File 'lib/ronin/web/user_agents.rb', line 113 def self.google_bot GoogleBot end |