reddit_junkie 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/bin/reddit_junkie +52 -0
- data/lib/reddit_junkie.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71920776834b7262d6b3b0cf592182003a567d15f83559999f8f99c24801dcbb
|
4
|
+
data.tar.gz: 831af04ddea38a9b74785f9bc6fe0f4453a60456346cd1cf6ffa863d69630a46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3310ef9a57516b653040fc0716badb935556a4a96135dbd0981a47acacc6efcf2ba6c1f452dce8b1ec09837dab5c50804b1581a4e2da3f7ff2df2062b50fd58
|
7
|
+
data.tar.gz: 4502f95c1b14e75c6c20f0440cd6dbd05a7bd99fe3f66dada47f8b031e21183b520852441d195fd7904a879c5da3ee9fdc6999a23d61bc51ad6b33014756aae9
|
data/bin/reddit_junkie
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
require_relative '../lib/reddit_junkie.rb'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
|
8
|
+
OptionParser.new do |option|
|
9
|
+
option.on("--subreddit SUB")
|
10
|
+
option.on("--directory DIR")
|
11
|
+
option.on("--count COUNT")
|
12
|
+
option.on("--endpoint ENDPOINT")
|
13
|
+
end.parse!(into: options)
|
14
|
+
|
15
|
+
if options[:subreddit] && options[:count] && options[:directory]
|
16
|
+
count = options[:count].to_i
|
17
|
+
if count%100 == 0
|
18
|
+
count_max = count / 100
|
19
|
+
count_min = 0
|
20
|
+
r = RedditImage.new(options[:subreddit], options[:count].to_i, options[:directory])
|
21
|
+
while count_min < count_max do
|
22
|
+
puts "Iteration No. #{count_min + 1}"
|
23
|
+
r.download_images
|
24
|
+
r.get_info
|
25
|
+
r.update_data
|
26
|
+
count_min += 1
|
27
|
+
end
|
28
|
+
else
|
29
|
+
r = RedditImage.new(options[:subreddit], options[:count].to_i, options[:directory])
|
30
|
+
r.download_images
|
31
|
+
end
|
32
|
+
elsif options[:subreddit] && options[:count]
|
33
|
+
count = options[:count].to_i
|
34
|
+
if count%100 == 0
|
35
|
+
count_max = count / 100
|
36
|
+
count_min = 0
|
37
|
+
r = RedditImage.new(options[:subreddit], options[:count].to_i)
|
38
|
+
while count_min < count_max do
|
39
|
+
puts "Iteration No. #{count_min + 1}"
|
40
|
+
r.download_images
|
41
|
+
r.get_info
|
42
|
+
r.update_data
|
43
|
+
count_min += 1
|
44
|
+
end
|
45
|
+
else
|
46
|
+
r = RedditImage.new(options[:subreddit], options[:count].to_i)
|
47
|
+
r.download_images
|
48
|
+
end
|
49
|
+
elsif options[:subreddit]
|
50
|
+
r = RedditImage.new(options[:subreddit])
|
51
|
+
r.download_images
|
52
|
+
end
|
data/lib/reddit_junkie.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reddit_junkie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muhammadreza Haghiri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -42,11 +42,13 @@ description: This little library helps people download images from different sub
|
|
42
42
|
much easier. It's actually like a crawler for the images posted on a subreddit.
|
43
43
|
Actually, it's a great tool to have your favorite memes locally!
|
44
44
|
email: haghiri75@gmail.com
|
45
|
-
executables:
|
45
|
+
executables:
|
46
|
+
- reddit_junkie
|
46
47
|
extensions: []
|
47
48
|
extra_rdoc_files: []
|
48
49
|
files:
|
49
50
|
- Gemfile
|
51
|
+
- bin/reddit_junkie
|
50
52
|
- lib/reddit_junkie.rb
|
51
53
|
homepage: http://github.com/prp-e/reddit_image_downloader
|
52
54
|
licenses:
|