dougsko-imagebin 0.1.7 → 0.2.3
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/Rakefile +2 -1
- data/VERSION.yml +2 -2
- data/bin/imagebin +4 -3
- data/bin/takeScreenshot.sh +18 -0
- data/lib/imagebin.rb +14 -0
- metadata +7 -6
- data/.document +0 -5
- data/.gitignore +0 -5
- data/imagebin.gemspec +0 -52
data/Rakefile
CHANGED
@@ -11,7 +11,8 @@ begin
|
|
11
11
|
gem.authors = ["dougsko"]
|
12
12
|
gem.add_dependency 'httpclient'
|
13
13
|
gem.description = 'Command line interface to imagebin.ca'
|
14
|
-
gem.require_paths = ['/bin']
|
14
|
+
gem.require_paths = ['/bin', '/lib']
|
15
|
+
gem.files = FileList["[A-Z]*", "{bin,generators,lib,spec}/**/*"]
|
15
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
17
|
end
|
17
18
|
rescue LoadError
|
data/VERSION.yml
CHANGED
data/bin/imagebin
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
require 'rubygems'
|
23
23
|
require 'optparse'
|
24
|
-
require '
|
24
|
+
require 'imagebin'
|
25
25
|
|
26
26
|
options = { "t" => "file",
|
27
27
|
"name" => "",
|
@@ -65,8 +65,9 @@ end
|
|
65
65
|
|
66
66
|
opts.parse(ARGV)
|
67
67
|
|
68
|
-
clnt = HTTPClient.new("http://imagebin.ca/upload.php")
|
69
68
|
File.open(options["f"]) do |file|
|
70
69
|
options["f"] = file
|
71
|
-
|
70
|
+
Imagebin.new(options) do |link|
|
71
|
+
puts link
|
72
|
+
end
|
72
73
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# Location to save files
|
4
|
+
WORKINGDIR=$HOME/screenshots
|
5
|
+
# Default delay before taking screenshots
|
6
|
+
DELAY=3
|
7
|
+
#Prefix to use for images captured.
|
8
|
+
PREFIX=screenshot
|
9
|
+
|
10
|
+
# Check if the dir to store the screenshots exists, else create it:
|
11
|
+
if [ ! -d "${WORKINGDIR}" ]; then mkdir "${WORKINGDIR}"; fi
|
12
|
+
|
13
|
+
i=`ls -l $WORKINGDIR/$PREFIX*.png | wc -l`
|
14
|
+
((i = i+1))
|
15
|
+
|
16
|
+
sleep $DELAY
|
17
|
+
import -window root $WORKINGDIR/$PREFIX-$i.png
|
18
|
+
zenity --info --text=`imagebin -p -f $WORKINGDIR/$PREFIX-$i.png`
|
data/lib/imagebin.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# imagebin.ca class
|
4
|
+
#
|
5
|
+
|
6
|
+
require 'rubygems'
|
7
|
+
require 'httpclient'
|
8
|
+
|
9
|
+
class Imagebin
|
10
|
+
def initialize(options)
|
11
|
+
@clnt = HTTPClient.new("http://imagebin.ca/upload.php")
|
12
|
+
yield @clnt.post('http://imagebin.ca/upload.php', options).content.match(/http.+?\.html/)
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dougsko-imagebin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dougsko
|
@@ -9,8 +9,8 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
13
|
-
default_executable:
|
12
|
+
date: 2009-08-31 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httpclient
|
@@ -26,20 +26,20 @@ description: Command line interface to imagebin.ca
|
|
26
26
|
email: dougtko@gmail.com
|
27
27
|
executables:
|
28
28
|
- imagebin
|
29
|
+
- takeScreenshot.sh
|
29
30
|
extensions: []
|
30
31
|
|
31
32
|
extra_rdoc_files:
|
32
33
|
- LICENSE
|
33
34
|
- README.rdoc
|
34
35
|
files:
|
35
|
-
- .document
|
36
|
-
- .gitignore
|
37
36
|
- LICENSE
|
38
37
|
- README.rdoc
|
39
38
|
- Rakefile
|
40
39
|
- VERSION.yml
|
41
40
|
- bin/imagebin
|
42
|
-
-
|
41
|
+
- bin/takeScreenshot.sh
|
42
|
+
- lib/imagebin.rb
|
43
43
|
- spec/imagebin_spec.rb
|
44
44
|
- spec/spec_helper.rb
|
45
45
|
has_rdoc: false
|
@@ -49,6 +49,7 @@ rdoc_options:
|
|
49
49
|
- --charset=UTF-8
|
50
50
|
require_paths:
|
51
51
|
- /bin
|
52
|
+
- /lib
|
52
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
54
|
requirements:
|
54
55
|
- - ">="
|
data/.document
DELETED
data/imagebin.gemspec
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{imagebin}
|
5
|
-
s.version = "0.1.7"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["dougsko"]
|
9
|
-
s.date = %q{2009-06-21}
|
10
|
-
s.default_executable = %q{imagebin}
|
11
|
-
s.description = %q{Command line interface to imagebin.ca}
|
12
|
-
s.email = %q{dougtko@gmail.com}
|
13
|
-
s.executables = ["imagebin"]
|
14
|
-
s.extra_rdoc_files = [
|
15
|
-
"LICENSE",
|
16
|
-
"README.rdoc"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".document",
|
20
|
-
".gitignore",
|
21
|
-
"LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION.yml",
|
25
|
-
"bin/imagebin",
|
26
|
-
"imagebin.gemspec",
|
27
|
-
"spec/imagebin_spec.rb",
|
28
|
-
"spec/spec_helper.rb"
|
29
|
-
]
|
30
|
-
s.homepage = %q{http://github.com/dougsko/imagebin}
|
31
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
32
|
-
s.require_paths = ["/bin"]
|
33
|
-
s.rubygems_version = %q{1.3.4}
|
34
|
-
s.summary = %q{Command line interface to imagebin.ca}
|
35
|
-
s.test_files = [
|
36
|
-
"spec/spec_helper.rb",
|
37
|
-
"spec/imagebin_spec.rb"
|
38
|
-
]
|
39
|
-
|
40
|
-
if s.respond_to? :specification_version then
|
41
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
42
|
-
s.specification_version = 3
|
43
|
-
|
44
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
45
|
-
s.add_runtime_dependency(%q<httpclient>, [">= 0"])
|
46
|
-
else
|
47
|
-
s.add_dependency(%q<httpclient>, [">= 0"])
|
48
|
-
end
|
49
|
-
else
|
50
|
-
s.add_dependency(%q<httpclient>, [">= 0"])
|
51
|
-
end
|
52
|
-
end
|