Skip to content

Commit

Permalink
登録者数が増加したときにもツイートするように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
karia committed Jun 10, 2020
1 parent 25e6ea6 commit e36b16f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions post-number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
num_diff = num_after - num_before

#Tweetする
if num_diff == 0
puts Time.now.strftime("%m/%d %H:%M").to_s + "現在、差分なし: " + num_after.to_s
if num_diff <= 0
puts Time.now.strftime("%m/%d %H:%M").to_s + "現在: " + num_after.to_s
else
channel_name = channel.title
item = "YouTubeチャンネル " + channel_name + " の登録者数: " + num_after.to_s + " (" + Time.now.strftime("%m/%d %H:%M").to_s + "現在、前回チェック時との差分" + num_diff.to_s + ")"
item = "YouTubeチャンネル " + channel_name + " の登録者数が " + num_after.to_s + " になりました (" + Time.now.strftime("%m/%d %H:%M").to_s + "現在)"
client.update(item)
puts "[ツイートしました]" + item
end

# 数字を保存
File.open(list_file, "w") do |f|
f.puts(num_after)
# 数字を保存
File.open(list_file, "w") do |f|
f.puts(num_after)
end
end

0 comments on commit e36b16f

Please sign in to comment.