smusher 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/smusher/smush_it.rb +14 -7
- data/smusher.gemspec +2 -2
- metadata +16 -16
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.9
|
data/lib/smusher/smush_it.rb
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
module Smusher
|
2
2
|
class SmushIt
|
3
|
+
#I leave these urls here, just in case it stops working again...
|
4
|
+
# URL = "http://smush.it/ws.php" # original, redirects to somewhere else..
|
5
|
+
# URL = "http://developer.yahoo.com/yslow/smushit/ws.php" # official but does not work
|
6
|
+
# URL = "http://smushit.com/ysmush.it/ws.php" # used at the new page but does not hande uploads
|
7
|
+
# URL = "http://smushit.eperf.vip.ac4.yahoo.com/ysmush.it/ws.php" # used at the new page but does not hande uploads
|
8
|
+
# URL = 'http://ws1.adq.ac4.yahoo.com/ysmush.it/ws.php'
|
9
|
+
# URL = 'www.smushit.com/ysmush.it/ws.php'
|
10
|
+
|
11
|
+
# How to find a new url:
|
12
|
+
# go to the smusher page and look for 'files' in the js source
|
13
|
+
# find then url where the 'files' get send + add /ws.php
|
14
|
+
URL = 'http://ypoweb-01.experf.gq1.yahoo.com/ysmush.it/ws.php'
|
15
|
+
|
3
16
|
def self.converts_gif_to_png?
|
4
17
|
true
|
5
18
|
end
|
6
19
|
|
7
20
|
def self.optimized_image_data_for(file)
|
8
|
-
|
9
|
-
# url = "http://smush.it/ws.php" # original, redirects to somewhere else..
|
10
|
-
# url = "http://developer.yahoo.com/yslow/smushit/ws.php" # official but does not work
|
11
|
-
# url = "http://smushit.com/ysmush.it/ws.php" # used at the new page but does not hande uploads
|
12
|
-
# url = "http://smushit.eperf.vip.ac4.yahoo.com/ysmush.it/ws.php" # used at the new page but does not hande uploads
|
13
|
-
url = 'http://ws1.adq.ac4.yahoo.com/ysmush.it/ws.php'
|
14
|
-
response = HTTPClient.post url, { 'files[]' => File.new(file)}
|
21
|
+
response = HTTPClient.post URL, 'files[]' => File.new(file)
|
15
22
|
response = JSON.parse(response.body)
|
16
23
|
raise "smush.it: #{response['error']}" if response['error']
|
17
24
|
image_url = response['dest']
|
data/smusher.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{smusher}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-11-18}
|
13
13
|
s.default_executable = %q{smusher}
|
14
14
|
s.email = %q{michael@grosser.it}
|
15
15
|
s.executables = ["smusher"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 9
|
10
|
+
version: 0.4.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -15,11 +15,12 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-18 00:00:00 -08:00
|
19
19
|
default_executable: smusher
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
22
|
+
type: :runtime
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
24
|
none: false
|
24
25
|
requirements:
|
25
26
|
- - ">="
|
@@ -28,12 +29,12 @@ dependencies:
|
|
28
29
|
segments:
|
29
30
|
- 0
|
30
31
|
version: "0"
|
31
|
-
prerelease: false
|
32
|
-
type: :runtime
|
33
|
-
requirement: *id001
|
34
32
|
name: rake
|
33
|
+
version_requirements: *id001
|
34
|
+
prerelease: false
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
36
|
+
type: :runtime
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
38
|
none: false
|
38
39
|
requirements:
|
39
40
|
- - ">="
|
@@ -42,12 +43,12 @@ dependencies:
|
|
42
43
|
segments:
|
43
44
|
- 0
|
44
45
|
version: "0"
|
45
|
-
prerelease: false
|
46
|
-
type: :runtime
|
47
|
-
requirement: *id002
|
48
46
|
name: json
|
47
|
+
version_requirements: *id002
|
48
|
+
prerelease: false
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
|
-
|
50
|
+
type: :runtime
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
52
|
none: false
|
52
53
|
requirements:
|
53
54
|
- - ">="
|
@@ -57,10 +58,9 @@ dependencies:
|
|
57
58
|
- 2
|
58
59
|
- 2
|
59
60
|
version: "2.2"
|
60
|
-
prerelease: false
|
61
|
-
type: :runtime
|
62
|
-
requirement: *id003
|
63
61
|
name: httpclient
|
62
|
+
version_requirements: *id003
|
63
|
+
prerelease: false
|
64
64
|
description:
|
65
65
|
email: michael@grosser.it
|
66
66
|
executables:
|