Created
February 5, 2016 18:10
-
-
Save takouhai/1f979ef09b41bbc68364 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :post do | |
desc 'Post Tweet' | |
task tweet: :environment do | |
puts 'Post Tweet' | |
param = Parameter.where(name: 'twitter').first | |
content = Content.where("name like ? and name like ?", "%\#devHangout%", "%" + param.value.to_s + "%").sort_by{|e| e[:id]}.first | |
puts content.name + " https://youtu.be/" + content.provider_id | |
param.value = param.value + 1 | |
param.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment