reddit-to-telegram 0.2.0 → 0.2.1

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: 36d1523dfcd1455f13aaf69a3460c86c588dc51a318c956bcaa25acbbee0cd82
4
- data.tar.gz: b5d4d20eedf4a41ffec66d26479955627e205c944696ef445e539e1bb2d9d2a0
3
+ metadata.gz: 1ec45bcf41a275baa3ea712968010d520b4af973a78149837ebe4cbc0b4c3870
4
+ data.tar.gz: 328805f68a80798c6c9c3a26fbd00aac37560ac97d55b601df9471b0587c2a31
5
5
  SHA512:
6
- metadata.gz: 51f3e8460aa53bb0d028e27b9852d9a23501a3fa4d6a886d382ae232d68d7a3fcf466c61af82fb38079eea4911fdb10cd830226b4bc4373b5a96426ce8e1378f
7
- data.tar.gz: 04465e55387e6e5c96e1b891a0ea2189538b9b038e92c80c7a369f4e417092b0f6b2dba6411f9ad83405d9712b764c53b6ab6e207b9bc99d5dd3005823ca8ecb
6
+ metadata.gz: 7184c7bddf2027cfef0bd40ddd90a044e309482b1467d1ab942114d43d4b6c4b7c03d2081a06035ba4b408d82aa19c64ba28d74d5ef98c03f58399153e61dbe3
7
+ data.tar.gz: e46c030bd186fbef1185970769d8d9263849e2b8048c043ca5b7ffa28c9a5b7d4e980fde260ee705ae2358419c7c581ebba458e620c68c3742541bc511dbdaae
data/README.md CHANGED
@@ -4,7 +4,8 @@
4
4
 
5
5
  #### Fetches hot posts from chosen subreddits and pushes them to Telegram channels.
6
6
 
7
- Beware, this is remotely not production-ready and you'll see lots of bugs. Be sure to check for gem updates.
7
+ Beware, this is remotely not production-ready, you'll see lots of bugs and it may break at any time.
8
+ Be sure to check for gem updates.
8
9
 
9
10
  ## Installation
10
11
  In your `Gemfile` add:
@@ -18,13 +19,13 @@ Or `gem install reddit-to-telegram`, but don't forget to `require` it first then
18
19
  ## Prerequisites
19
20
  - You need an AWS account to host a free SimpleDB (memory and local file storage options are available, but no way to switch for now)
20
21
  - (Optionally) Create a Reddit app, which would allow more requests to reddit
21
- - [Obtain](https://core.telegram.org/bots/tutorial#create-your-project) a telegram bot token
22
+ - [Obtain](https://core.telegram.org/bots/tutorial#obtain-your-bot-token) a telegram bot token
22
23
 
23
24
  ## Installation
24
25
  To run it, you'll need some env variables set.
25
26
  ```
26
27
  RTT_AWS_ACCESS_KEY_ID= # Your AWS access key ID. Needed for AWS SimpleDB storage.
27
- RTT_AWS_REGION= # AWS region your SimpleDB will be hosted on. Beware, it's on available in all regions.
28
+ RTT_AWS_REGION= # AWS region your SimpleDB will be hosted on. Beware, it's not available in all regions.
28
29
  RTT_AWS_SECRET_ACCESS_KEY= # Your AWS access key ID. Needed for AWS SimpleDB storage.
29
30
  RTT_MAX_STORED_POSTS= # (Optional) Number of posts to store in the database to avoid duplicates, default is 25.
30
31
  RTT_REDDIT_CLIENT_ID= # Reddit app credentials to access API. Might not be needed depending on setup, reddit allows some requests without authentication.
@@ -37,6 +38,7 @@ You can also set them dynamically:
37
38
  ```
38
39
  RedditToTelegram::Vars.assign_values(
39
40
  max_stored_posts:,
41
+ tmp_dir:
40
42
  aws_access_key_id:,
41
43
  aws_secret_access_key:,
42
44
  aws_region:,
@@ -57,7 +59,3 @@ RedditToTelegram.post(
57
59
 
58
60
  ```
59
61
  Use `:telegram_channel_id` without the `@`.
60
-
61
- ## TODO
62
- - Storage options
63
- - Error handling (maybe send them to another channel in Telegram)
@@ -15,10 +15,11 @@ module RedditToTelegram
15
15
  end
16
16
 
17
17
  def delete_file
18
+ return unless File.exist?(temp_video_path)
19
+
18
20
  f = File.open(temp_video_path, "r")
19
- ensure
20
21
  f.close unless f.nil? || f.closed?
21
- File.delete(temp_video_path) if File.exist?(temp_video_path)
22
+ File.delete(temp_video_path)
22
23
  end
23
24
 
24
25
  def temp_video_path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedditToTelegram
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit-to-telegram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Tityuk