Skip to content

Instantly share code, notes, and snippets.

@takouhai
Created February 5, 2016 18:10
Show Gist options
  • Save takouhai/1f979ef09b41bbc68364 to your computer and use it in GitHub Desktop.
Save takouhai/1f979ef09b41bbc68364 to your computer and use it in GitHub Desktop.
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