I want to have a GET route that will query an API to collect data, and then redirect to a POST with that data to save to the DB. For example:
get '/query/twitter/company/:name' do
get_number_of_tweets_for_day( params[:name] )
end
POST '/company/tweets/' do
company.tweets.create(:date => time_now, :count => num_tweets)
end
How do I set the parameters from the data returned by the function in the GET route, and pass them to the POST route so I can save to the DB?