reddit_post_to_markdown 0.1.1 → 0.2.0

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
  SHA256:
3
- metadata.gz: 3b71d407ce547e59be02bec0f63ec65f30cf6eb518d0cd8bb6045baecd0b1b73
4
- data.tar.gz: ba3d8ae097aed561c3b4cb9970db384d49193c3c2c2666fb97641a999a9fcfc6
3
+ metadata.gz: 37b7ab66e1f79d44320d9e0faa596663be2849e1118c495a5ae58930a3fd3d9b
4
+ data.tar.gz: ffda7283ff6597b0a9b6098674fd76e617c1b9d0e8666605d816e743ea914f86
5
5
  SHA512:
6
- metadata.gz: 6bcf46441425954a79db588f7bc76b9b746a13acb51fd88909b77c110d427a98c33f4e76778911ab8875736c47a14952bb91964d195bf4e21408d9426e066338
7
- data.tar.gz: aab145ee470c38ad201c0bd0e18cc1a66c16cb65c192eb63521665612d871d06cac85287552c9d4133d35fffadde5ee4b98ff66d3455950b0d5b662172736888
6
+ metadata.gz: 781345b4d59eb26e7118149590f116a1e69c2be3a77bbc64a4234793ace76b26318c634db722c5bf4a13b4db45485bdce61c2d68160cc7145e0ef5eccaee24ba
7
+ data.tar.gz: 31de8a980cd49b874dfed294515a1807dd52e349b478f6c608129c476cb6e6e33f9c37f0361d95b7e522a1a014ac8d1440ce386f658eef0b59f041161b095afd
@@ -23,10 +23,10 @@ module RedditPostToMarkdown
23
23
  # @raise [FetchError] if the server returns a non-2xx HTTP status
24
24
  # @raise [InvalidResponseError] if the parsed response is not a two-element
25
25
  # Array
26
- def fetch_post(url)
26
+ def fetch_post(url, user_agent: USER_AGENT)
27
27
  json_url = url.end_with?(".json") ? url : "#{url}.json"
28
28
 
29
- response = self.class.get(json_url, headers: { "User-Agent" => USER_AGENT })
29
+ response = self.class.get(json_url, headers: { "User-Agent" => user_agent })
30
30
 
31
31
  raise FetchError, "HTTP #{response.code} fetching #{url}" unless response.success?
32
32
 
@@ -1,3 +1,3 @@
1
1
  module RedditPostToMarkdown
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,3 +1,6 @@
1
+ warn "[DEPRECATION] reddit_post_to_markdown is deprecated and no longer maintained. " \
2
+ "Reddit is shutting down unauthenticated access to post JSON, so this gem no longer works."
3
+
1
4
  require_relative "reddit_post_to_markdown/version"
2
5
  require_relative "reddit_post_to_markdown/errors"
3
6
  require_relative "reddit_post_to_markdown/url_validator"
@@ -6,10 +6,16 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["masukomi"]
7
7
  spec.email = ["masukomi@masukomi.org"]
8
8
  spec.homepage = "https://github.com/masukomi/reddit_post_to_markdown"
9
- spec.summary = "Download a public Reddit post and convert it to Markdown"
10
- spec.description = "Takes the URL of a public Reddit post, downloads the post and its comments via the Reddit JSON API, and returns the content as a Markdown string."
9
+ spec.summary = "DEPRECATED: Download a public Reddit post and convert it to Markdown"
10
+ spec.description = "DEPRECATED and no longer maintained. Reddit is shutting down unauthenticated access to post JSON, so this gem no longer works. Originally: takes the URL of a public Reddit post, downloads the post and its comments via the Reddit JSON API, and returns the content as a Markdown string."
11
11
  spec.license = "MIT"
12
12
 
13
+ spec.post_install_message = <<~MSG
14
+ WARNING: reddit_post_to_markdown is DEPRECATED and no longer maintained.
15
+ Reddit is shutting down unauthenticated access to post JSON, so this gem
16
+ no longer works. See #{spec.homepage} for details.
17
+ MSG
18
+
13
19
  spec.required_ruby_version = ">= 2.7"
14
20
 
15
21
  spec.metadata["homepage_uri"] = spec.homepage
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit_post_to_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - masukomi
@@ -51,8 +51,10 @@ dependencies:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
53
  version: '3.26'
54
- description: Takes the URL of a public Reddit post, downloads the post and its comments
55
- via the Reddit JSON API, and returns the content as a Markdown string.
54
+ description: 'DEPRECATED and no longer maintained. Reddit is shutting down unauthenticated
55
+ access to post JSON, so this gem no longer works. Originally: takes the URL of a
56
+ public Reddit post, downloads the post and its comments via the Reddit JSON API,
57
+ and returns the content as a Markdown string.'
56
58
  email:
57
59
  - masukomi@masukomi.org
58
60
  executables: []
@@ -73,6 +75,10 @@ metadata:
73
75
  homepage_uri: https://github.com/masukomi/reddit_post_to_markdown
74
76
  source_code_uri: https://github.com/masukomi/reddit_post_to_markdown
75
77
  changelog_uri: https://github.com/masukomi/reddit_post_to_markdown/CHANGELOG.org
78
+ post_install_message: |
79
+ WARNING: reddit_post_to_markdown is DEPRECATED and no longer maintained.
80
+ Reddit is shutting down unauthenticated access to post JSON, so this gem
81
+ no longer works. See https://github.com/masukomi/reddit_post_to_markdown for details.
76
82
  rdoc_options: []
77
83
  require_paths:
78
84
  - lib
@@ -89,5 +95,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
95
  requirements: []
90
96
  rubygems_version: 4.0.7
91
97
  specification_version: 4
92
- summary: Download a public Reddit post and convert it to Markdown
98
+ summary: 'DEPRECATED: Download a public Reddit post and convert it to Markdown'
93
99
  test_files: []