Guest User

Untitled

a guest
Oct 20th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. class Plugins::PluginInstagramsController < Plugins::BaseController
  2.  
  3. def handle_user_subscription
  4. if request.get?
  5. render :text => params['hub.challenge'] and return
  6. end
  7. if request.post?
  8. notifications = params['_json']
  9. for n in notifications
  10. logger.debug "Adding new photo: " << n.to_s
  11. plugin = PluginInstagram.find_by_instagram_user_id(n['object_id'].to_i)
  12. job = Delayed::Job.enqueue CachePhotoJob.new(plugin)
  13. end
  14. end
  15. render :nothing => true
  16. end
  17. end
Add Comment
Please, Sign In to add comment