docbrown/app/controllers/internal/buffer_updates_controller.rb
Ben Halpern 2517bb555b
Add functionality for buffering to different accounts (#752)
* Create initial buffer updates logic

* Add UI functionality and test for sattelite tweets

* Add additional /mod functionality and re-use script partial in /internal
2018-09-26 15:51:39 -04:00

17 lines
590 B
Ruby

class Internal::BufferUpdatesController < Internal::ApplicationController
def create
article = Article.find(params[:article_id])
fb_post = params[:fb_post]
tweet = params[:tweet]
if params[:social_channel] == "main_twitter"
Bufferizer.new(article, tweet).main_teet!
render body: nil
elsif params[:social_channel] == "satellite_twitter"
Bufferizer.new(article, tweet).satellite_tweet!
render body: nil
elsif params[:social_channel] == "facebook"
Bufferizer.new(article, fb_post).facebook_post!
render body: nil
end
end
end