Module: Ronin::Web::UserAgents::InternetArchive
- Defined in:
- lib/ronin/web/user_agents/internet_archive.rb
Overview
Represents every possible Internet Archive crawler User-Agent string.
Constant Summary collapse
- HEX_CHARS =
          Array of hexadecimal characters. 
- %w[0 1 2 3 4 5 6 7 8 9 a b c d e f] 
Class Method Summary collapse
- 
  
    
      .build(date:, bot_id:)  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Builds an Internet Archive crawler User-Agentstring.
- 
  
    
      .random(date: Date.today, bot_id: random_hex_id)  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Generates a random Internet Archive User-AgentString.
- 
  
    
      .random_hex_id  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    Generates a random hex ID. 
Class Method Details
.build(date:, bot_id:) ⇒ String
Builds an Internet Archive crawler User-Agent string.
| 52 53 54 55 56 | # File 'lib/ronin/web/user_agents/internet_archive.rb', line 52 def self.build(date: , bot_id: ) = date.strftime("%Y%m%d") return "ArchiveTeam ArchiveBot/#{}.#{bot_id} (wpull 2.0.3) and not Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36" end | 
.random(date: Date.today, bot_id: random_hex_id) ⇒ String
Generates a random Internet Archive User-Agent String.
| 70 71 72 | # File 'lib/ronin/web/user_agents/internet_archive.rb', line 70 def self.random(date: Date.today, bot_id: random_hex_id) build(date: date, bot_id: bot_id) end | 
.random_hex_id ⇒ String
Generates a random hex ID.
| 36 37 38 | # File 'lib/ronin/web/user_agents/internet_archive.rb', line 36 def self.random_hex_id Array.new(7) { HEX_CHARS.sample }.join end |