cherrypicker 0.3.13 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,6 @@ require 'net/http'
9
9
  require 'net/https'
10
10
  require 'progressbar'
11
11
  require 'open-uri'
12
- require 'progress'
13
12
 
14
13
  module Cherrypicker
15
14
  def self.remote_query(url)
@@ -62,6 +61,8 @@ module Cherrypicker
62
61
  end
63
62
 
64
63
  puts "unknown file size for #{@filename} but downloading..." if @size.nil?
64
+ puts @link.to_s
65
+
65
66
  http.request(request) do |response|
66
67
  bar = ProgressBar.new((@filename ||= File.basename(uri.path)), @size.to_i) unless @size.nil?
67
68
  bar.format_arguments=[:title, :percentage, :bar, :stat_for_file_transfer] unless @size.nil?
@@ -74,7 +75,7 @@ module Cherrypicker
74
75
  end
75
76
  end
76
77
  end
77
-
78
+
78
79
  @finished = true
79
80
  puts
80
81
  puts "download completed"
@@ -89,7 +90,18 @@ module Cherrypicker
89
90
  end
90
91
 
91
92
  def self.random_agent
92
- @useragent = ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24"]
93
- return @useragent[0]
93
+ useragent = [ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3",
94
+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)",
95
+ "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)",
96
+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1",
97
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1",
98
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)",
99
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)",
100
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)",
101
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)",
102
+ "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)",
103
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
104
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24"]
105
+ return useragent[rand(useragent.length)]
94
106
  end
95
107
  end
@@ -1,3 +1,3 @@
1
1
  module Cherrypicker
2
- VERSION = "0.3.13"
2
+ VERSION = "0.3.14"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cherrypicker
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.13
5
+ version: 0.3.14
6
6
  platform: ruby
7
7
  authors:
8
8
  - Karl Entwistle