Changeset 1221

Show
Ignore:
Timestamp:
08/14/09 22:17:35 (4 years ago)
Author:
mbarry
Message:

Shepherd::Common: Set defaults in UA setup, not just get_url

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/references/Shepherd/Common.pm

    r1095 r1221  
    33# Shepherd::Common library 
    44 
    5 my $version = '0.37'; 
     5my $version = '0.38'; 
    66 
    77# 
     
    582582    $cnf{debug} = 1 if (!defined $cnf{debug}); 
    583583 
     584    # App defaults 
     585    foreach my $k (keys %defaults) { 
     586        $cnf{$k} = $defaults{$k} unless (defined $cnf{$k}); 
     587    } 
     588    # Defaults 
     589    $cnf{method} = 'GET' unless (defined $cnf{method}); 
     590    $cnf{retries} = 2 unless (defined $cnf{retries}); 
     591    $cnf{fake} = 1 unless (defined $cnf{fake}); 
     592    $cnf{gzip} = 1 unless (defined $cnf{gzip}); 
     593    $cnf{delay} = 0 unless (defined $cnf{delay}); 
     594    $cnf{retry_delay} = 10 unless (defined $cnf{retry_delay} or $cnf{delay}); 
     595    $cnf{debug} = 1 unless (defined $cnf{debug}); 
     596                                      
    584597    print "Establishing user agent.\n" if ($cnf{debug} > 3); 
    585598 
     
    588601 
    589602    my @agent_list = ( 
     603        'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)', 
    590604        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0', 
    591         'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0', 
    592605        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15', 
    593606        'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0) Gecko/2008061600 SUSE/3.0-0.2 Firefox/3.0', 
    594         'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0', 
    595607        'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9) Gecko/20080617 Firefox/3.0', 
    596608        'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0', 
    597609 
     610        'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; .NET CLR 2.0.50727)', 
    598611        'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)', 
    599         'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)', 
    600         'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', 
    601612        'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)', 
    602613        'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', 
    603         'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)', 
    604  
     614 
     615        'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5', 
    605616        'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.17', 
    606617        'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1', 
    607618 
     619        'Opera/9.63 (Windows NT 5.1; U; en)', 
    608620        'Opera/9.51 (Windows NT 6.0; U; en)', 
    609621        'Opera/9.51 (Windows NT 5.1; U; en)' 
     
    612624    my $agent = ($cnf{fake} ? $agent_list[int(rand($#agent_list+1))] : ($cnf{agent} ? $cnf{agent} : 'Shepherd')); 
    613625    $ua->agent($agent); 
    614                  
    615626    print "User Agent string set to \"" . $ua->agent() . "\".\n" if ($cnf{debug} > 3);  
    616627 
  • trunk/status

    r1220 r1221  
    11application     shepherd            1.3.40 
    22reference       channel_list        39 
    3 reference       Shepherd/Common.pm  0.37 
     3reference       Shepherd/Common.pm  0.38 
    44reference       Shepherd/MythTV.pm  0.9 
    55reference       Shepherd/Configure.pm   0.17