reddit_bot 1.7.1 → 1.7.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0c2300acde2d22f7930194e570c8eb671e84dd2
4
- data.tar.gz: a4178a9953e36202f88fa45d3934c44ad9d11e68
3
+ metadata.gz: 72f9dc552d1471c35792e1633fd4fd2e466a2ee9
4
+ data.tar.gz: feb6cfce26ffc0fbbe6bff80ea3e776398143f69
5
5
  SHA512:
6
- metadata.gz: 7cf72c64667d8e5b8e087b43f43dcf4baab07ffd9c9ca0eb590db6cffd1d7b4d7f5f3ae5574de366d04de54b8c83ba93ed5d70cfb9ff9e83b21c10f0d5fc08bc
7
- data.tar.gz: b899316e434b78d706e22ab7aca57a6969155d1755a8eeaad3b972180e28e10f463c4e3faa0af3b7b2f5e24046e6335efa57281ea2f5c6e508ff37afe2650395
6
+ metadata.gz: 5127199b9b40bb025a31deb32ed724f56e1d3ea9932980b33374751702214f0a399db95d9a2609ac4b5feaa1fd76c82a027414f6efe87a15b6d8c0e9becfb673
7
+ data.tar.gz: 7d2a70330ddcb412a0a3288d55ef020cb99f0ad565f39a47133c18bfd4b12efc39a7870b2f3be65de64fe646d9178755bfe1ab3683aacfa151873d2a43a9036b
data/README.md CHANGED
@@ -79,7 +79,7 @@ You obviously can't run these examples as is, because they use local configs tha
79
79
  :login: MyBotUsername
80
80
  # :user_agent: optional_custom_useragent_to_bypass_reddit_spam_protection
81
81
 
82
- To change the log level:
82
+ To change log level:
83
83
 
84
84
  ```ruby
85
85
  RedditBot.logger.level = Logger::ERROR
@@ -2,11 +2,10 @@
2
2
 
3
3
  gem "json"
4
4
 
5
- gem "reddit_bot"
6
5
  gem "nokogiri"
7
6
 
8
- gem "fastimage", git: "git@github.com:sdsykes/fastimage.git", ref: "15bc4111c4c4e1af580b63c62e08decf2d5527d5"
9
- gem "directlink", git: "git@github.com:Nakilon/directlink.git"
7
+ gem "nethttputils", git: "git@github.com:nakilon/nethttputils.git"
8
+ gem "directlink", git: "git@github.com:nakilon/directlink.git"
10
9
 
11
- gem "gcplogger", git: "git@github.com:Nakilon/gcplogger.git", tag: "v0.1.1.0"
10
+ gem "gcplogger", git: "git@github.com:nakilon/gcplogger.git", tag: "v0.1.1.0"
12
11
  gem "google-cloud-error_reporting"
@@ -1,16 +1,17 @@
1
1
  GIT
2
- remote: git@github.com:Nakilon/directlink.git
3
- revision: 8c829c76ede9734a51e7e416d9cd309dc28dc9d8
2
+ remote: git@github.com:nakilon/directlink.git
3
+ revision: a1645d3abca0182e6de80f1a7b37b6ad0513b672
4
4
  specs:
5
- directlink (0.0.4.4)
5
+ directlink (0.0.6.0)
6
6
  addressable
7
7
  fastimage (~> 2.1.3)
8
8
  kramdown
9
+ nethttputils (~> 0.3.2.3)
9
10
  nokogiri
10
- reddit_bot (~> 1.6.7)
11
+ reddit_bot (~> 1.7.0)
11
12
 
12
13
  GIT
13
- remote: git@github.com:Nakilon/gcplogger.git
14
+ remote: git@github.com:nakilon/gcplogger.git
14
15
  revision: 7c1451fac49bd0d242c6de43315ae6e9a70d8f7f
15
16
  tag: v0.1.1.0
16
17
  specs:
@@ -19,19 +20,19 @@ GIT
19
20
  public_suffix (~> 2.0)
20
21
 
21
22
  GIT
22
- remote: git@github.com:sdsykes/fastimage.git
23
- revision: 15bc4111c4c4e1af580b63c62e08decf2d5527d5
24
- ref: 15bc4111c4c4e1af580b63c62e08decf2d5527d5
23
+ remote: git@github.com:nakilon/nethttputils.git
24
+ revision: 6450111a35803b474c2331d8e12da6546101c887
25
25
  specs:
26
- fastimage (2.1.3)
26
+ nethttputils (0.3.2.6)
27
27
 
28
28
  GEM
29
29
  remote: https://rubygems.org/
30
30
  specs:
31
- addressable (2.5.2)
31
+ addressable (2.6.0)
32
32
  public_suffix (>= 2.0.2, < 4.0)
33
33
  faraday (0.14.0)
34
34
  multipart-post (>= 1.2, < 3)
35
+ fastimage (2.1.5)
35
36
  google-cloud-core (1.2.0)
36
37
  google-cloud-env (~> 1.0)
37
38
  google-cloud-env (1.0.1)
@@ -69,25 +70,24 @@ GEM
69
70
  google-protobuf (~> 3.1)
70
71
  googleapis-common-protos-types (~> 1.0.0)
71
72
  googleauth (>= 0.5.1, < 0.7)
72
- json (2.1.0)
73
+ json (2.2.0)
73
74
  jwt (2.1.0)
74
- kramdown (1.17.0)
75
+ kramdown (2.1.0)
75
76
  little-plugger (1.1.4)
76
77
  logging (2.2.2)
77
78
  little-plugger (~> 1.1)
78
79
  multi_json (~> 1.10)
79
80
  memoist (0.16.0)
80
- mini_portile2 (2.3.0)
81
+ mini_portile2 (2.4.0)
81
82
  multi_json (1.13.1)
82
83
  multipart-post (2.0.0)
83
- nethttputils (0.2.5.1)
84
- nokogiri (1.8.4)
85
- mini_portile2 (~> 2.3.0)
84
+ nokogiri (1.10.2)
85
+ mini_portile2 (~> 2.4.0)
86
86
  os (0.9.6)
87
87
  public_suffix (2.0.5)
88
- reddit_bot (1.6.13)
88
+ reddit_bot (1.7.1)
89
89
  json
90
- nethttputils (~> 0.2.5.1)
90
+ nethttputils (~> 0.3.2.0)
91
91
  rly (0.2.3)
92
92
  signet (0.8.1)
93
93
  addressable (~> 2.3)
@@ -102,12 +102,11 @@ PLATFORMS
102
102
 
103
103
  DEPENDENCIES
104
104
  directlink!
105
- fastimage!
106
105
  gcplogger!
107
106
  google-cloud-error_reporting
108
107
  json
108
+ nethttputils!
109
109
  nokogiri
110
- reddit_bot
111
110
 
112
111
  BUNDLED WITH
113
112
  1.17.1
@@ -105,7 +105,7 @@ loop do
105
105
  DirectLink::ErrorBadLink => e
106
106
  next logger.error "skipped (#{e}) #{url} from http://redd.it/#{id}"
107
107
  end
108
- logger.info "DirectLink: %p" % t
108
+ logger.info "DirectLink: #{t.inspect}"
109
109
  tt = t.is_a?(Array) ? t : [t]
110
110
  next logger.error "probably crosspost of a self post: http://redd.it/#{id}" if tt.empty?
111
111
  unless min_resolution <= tt.first.width * tt.first.height
@@ -1,11 +1,11 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- json (2.1.0)
5
- nethttputils (0.2.5.1)
6
- reddit_bot (1.6.10)
4
+ json (2.2.0)
5
+ nethttputils (0.3.2.6)
6
+ reddit_bot (1.7.1)
7
7
  json
8
- nethttputils (~> 0.2.5.1)
8
+ nethttputils (~> 0.3.2.0)
9
9
 
10
10
  PLATFORMS
11
11
  ruby
@@ -14,4 +14,4 @@ DEPENDENCIES
14
14
  reddit_bot
15
15
 
16
16
  BUNDLED WITH
17
- 1.17.1
17
+ 2.0.1
@@ -37,11 +37,11 @@ tweet2titleNtext = lambda do |tweet|
37
37
  [CGI::unescapeHTML(tweet["full_text"]).sub(/( https:\/\/t\.co\/[0-9a-zA-Z]{10})*\z/, ""), text, contains_media]
38
38
  end
39
39
  [
40
- [905764294687633408, true, "The Polish government & military high command is now evacuating Warsaw for Brest, 120 miles east: German armies are too close to the capital", "* [Image 1](https://pbs.twimg.com/media/DJHq71BXYAA6KJ0.jpg)\n\n" "^- ^WW2 ^Tweets ^from ^1940 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^""September ^7, ^2017](https://twitter.com/#{TWITTER}/status/905764294687633408)"],
41
- [915534673471733760, true, "In east Poland (now Soviet Ukraine) industry & farms to be collectivised, political parties banned, aristocrats & capitalists \"re-educated\".", "* [Image 1](https://pbs.twimg.com/media/DLSh2J9W4AACcOG.jpg)\n\n* [Image 2](https://pbs.twimg.com/media/DLSh4sKX0AEBaXq.jpg)\n\n^- ^WW2 ^Tweets ^from ^1940 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "October ^4, ^2017](https://twitter.com/#{TWITTER}/status/915534673471733760)"],
42
- [915208866408824832, true, "For 1st time, RAF planes dropping propaganda leaflets on Berlin itself, entitled \"Germans: these are your leaders!\"", "* [Image 1](https://pbs.twimg.com/media/DLN5jJ-XkAEUz9M.jpg)\n\n* [Link 1](https://www.psywar.org/product_1939EH158.php)\n\n" "^- ^WW2 ^Tweets ^from ^1940 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "October ^3, ^2017](https://twitter.com/#{TWITTER}/status/915208866408824832)"],
43
- [914577848891006978, true, "\"In Poland, Russia pursued a cold policy of selfinterest. But clearly necessary for Russia… against Nazi menace.\"", "* [Link 1](https://www.youtube.com/watch?v=ygmP5A3n2JA)\n\n" "^- ^WW2 ^Tweets ^from ^1940 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "October ^1, ^2017](https://twitter.com/#{TWITTER}/status/914577848891006978)"],
44
- [926581977372942336, false, "Finland rejects Soviet demand to surrender land near Leningrad & give Red Navy base in Hanko; Soviets now claim Finns' manner \"warlike\".", "^- ^WW2 ^Tweets ^from ^1940 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "November ^3, ^2017](https://twitter.com/#{TWITTER}/status/926581977372942336)"],
40
+ [905764294687633408, true, "The Polish government & military high command is now evacuating Warsaw for Brest, 120 miles east: German armies are too close to the capital", "* [Image 1](https://pbs.twimg.com/media/DJHq71BXYAA6KJ0.jpg)\n\n" "^- ^WW2 ^Tweets ^from ^1941 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^""September ^7, ^2017](https://twitter.com/#{TWITTER}/status/905764294687633408)"],
41
+ [915534673471733760, true, "In east Poland (now Soviet Ukraine) industry & farms to be collectivised, political parties banned, aristocrats & capitalists \"re-educated\".", "* [Image 1](https://pbs.twimg.com/media/DLSh2J9W4AACcOG.jpg)\n\n* [Image 2](https://pbs.twimg.com/media/DLSh4sKX0AEBaXq.jpg)\n\n^- ^WW2 ^Tweets ^from ^1941 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "October ^4, ^2017](https://twitter.com/#{TWITTER}/status/915534673471733760)"],
42
+ [915208866408824832, true, "For 1st time, RAF planes dropping propaganda leaflets on Berlin itself, entitled \"Germans: these are your leaders!\"", "* [Image 1](https://pbs.twimg.com/media/DLN5jJ-XkAEUz9M.jpg)\n\n* [Link 1](https://www.psywar.org/product_1939EH158.php)\n\n" "^- ^WW2 ^Tweets ^from ^1941 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "October ^3, ^2017](https://twitter.com/#{TWITTER}/status/915208866408824832)"],
43
+ [914577848891006978, true, "\"In Poland, Russia pursued a cold policy of selfinterest. But clearly necessary for Russia… against Nazi menace.\"", "* [Link 1](https://www.youtube.com/watch?v=ygmP5A3n2JA)\n\n" "^- ^WW2 ^Tweets ^from ^1941 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "October ^1, ^2017](https://twitter.com/#{TWITTER}/status/914577848891006978)"],
44
+ [926581977372942336, false, "Finland rejects Soviet demand to surrender land near Leningrad & give Red Navy base in Hanko; Soviets now claim Finns' manner \"warlike\".", "^- ^WW2 ^Tweets ^from ^1941 [^\\(@#{TWITTER}\\)](https://twitter.com/#{TWITTER}) ^| [^" "November ^3, ^2017](https://twitter.com/#{TWITTER}/status/926581977372942336)"],
45
45
  ].each do |id, contains_media_, title_, text_|
46
46
  title, text, contains_media = tweet2titleNtext[ JSON.load NetHTTPUtils.request_data(
47
47
  "https://api.twitter.com/1.1/statuses/show.json",
data/lib/reddit_bot.rb CHANGED
@@ -245,6 +245,7 @@ module RedditBot
245
245
 
246
246
  def reddit_resp *args
247
247
  mtd, url, form, headers, basic_auth = *args
248
+ headers["Cookie:"] = "over18=1"
248
249
  begin
249
250
  NetHTTPUtils.request_data(url, mtd, form: form, header: headers, auth: basic_auth) do |response|
250
251
  next unless remaining = response.to_hash["x-ratelimit-remaining"]
@@ -1,3 +1,3 @@
1
1
  module RedditBot
2
- VERSION = "1.7.1" # :nodoc:
2
+ VERSION = "1.7.2" # :nodoc:
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-20 00:00:00.000000000 Z
11
+ date: 2019-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json