Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
1109fff818 | |||
6bdcf4fb41 | |||
7b59637189 | |||
98836d8ad8 |
7 changed files with 28 additions and 47 deletions
23
README.md
23
README.md
|
@ -1,22 +1,21 @@
|
|||
# ../imgur::Albumkeeper
|
||||
|
||||
Download imgur.com galleries easily
|
||||
#
|
||||
# Usage:
|
||||
# ruby imgur.rb [url of gallery] [directory to download into] [namespace for files]
|
||||
#
|
||||
# Example:
|
||||
# ruby imgur.rb http://imgur.com/a/npV94 battlefield3 scenery
|
||||
# All files will be downloaded into battlefield3 with filenames in the pattern of
|
||||
# scenery-[number].jpg
|
||||
TODO: Write a gem description
|
||||
|
||||
## Installation
|
||||
|
||||
Add this line to your application's Gemfile:
|
||||
Install it yourself as:
|
||||
|
||||
```ruby
|
||||
gem '../imgur-albumkeeper'
|
||||
```
|
||||
|
||||
And then execute:
|
||||
|
||||
$ bundle
|
||||
|
||||
Or install it yourself as:
|
||||
|
||||
$ gem install ../imgur-albumkeeper
|
||||
$ gem install imgur2comicbook
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -1,19 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
# Download imgur.com galleries easily
|
||||
#
|
||||
# Requirements:
|
||||
# gem install nokogiri
|
||||
#
|
||||
# Usage:
|
||||
# ruby imgur.rb [url of gallery] [directory to download into] [namespace for files]
|
||||
#
|
||||
# Example:
|
||||
# ruby imgur.rb http://imgur.com/a/npV94 battlefield3 scenery
|
||||
# All files will be downloaded into battlefield3 with filenames in the pattern of
|
||||
# scenery-[number].jpg
|
||||
|
||||
|
||||
require 'nokogiri'
|
||||
require 'open-uri'
|
||||
require 'date'
|
||||
|
@ -22,6 +8,7 @@ require 'optparse'
|
|||
require 'pp'
|
||||
require "shellwords"
|
||||
|
||||
require 'imgur2comicbook'
|
||||
|
||||
def album_url origin_url
|
||||
url = URI.parse origin_url
|
||||
|
@ -63,15 +50,14 @@ end
|
|||
|
||||
options = parse_cmdline ARGV
|
||||
|
||||
#pp options
|
||||
#pp ARGV
|
||||
#exit 0
|
||||
|
||||
images = []
|
||||
now = Time.now
|
||||
if ARGV[0].nil? then
|
||||
STDERR.puts "Missing URL."
|
||||
exit 1
|
||||
end
|
||||
url = album_url(ARGV[0])
|
||||
directory = ( defined?(ARGV[1]) ? ARGV[1] : nil )
|
||||
#namespace = ( defined?(ARGV[2]) ? ARGV[2] : "image" )
|
||||
namespace = "image"
|
||||
|
||||
# filter url
|
||||
|
@ -123,7 +109,7 @@ end
|
|||
FileUtils.touch "#{directory}/.imguralbum"
|
||||
|
||||
if options[:zip] then
|
||||
%x{zip -r #{directory.shellescape}.cbz #{directory.shellescape}}
|
||||
system "zip -r #{directory.shellescape}.cbz #{directory.shellescape}"
|
||||
FileUtils.rm_rf directory
|
||||
end
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
# coding: utf-8
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
require 'imgur-albumkeeper/version'
|
||||
require 'imgur2comicbook/version'
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "imgur-albumkeeper"
|
||||
spec.version = Gsfe::VERSION
|
||||
spec.name = "imgur2comicbook"
|
||||
spec.version = Imgur2ComicBook::VERSION
|
||||
spec.authors = ["Glenn Y. Rolland"]
|
||||
spec.email = ["glenn.rolland@netcat.io"]
|
||||
spec.summary = %q{Archive imgur albums.}
|
|
@ -1,7 +0,0 @@
|
|||
require "../imgur/albumkeeper/version"
|
||||
|
||||
module ../imgur
|
||||
module Albumkeeper
|
||||
# Your code goes here...
|
||||
end
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
module ../imgur
|
||||
module Albumkeeper
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
end
|
5
lib/imgur2comicbook.rb
Normal file
5
lib/imgur2comicbook.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "imgur2comicbook/version"
|
||||
|
||||
module Imgur2ComicBook
|
||||
# Your code goes here...
|
||||
end
|
3
lib/imgur2comicbook/version.rb
Normal file
3
lib/imgur2comicbook/version.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
module Imgur2ComicBook
|
||||
VERSION = "0.0.1"
|
||||
end
|
Loading…
Reference in a new issue