Guest User

Untitled

a guest
Jun 4th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. require "twitter"
  2. class MainController < ApplicationController
  3. def new
  4. end
  5.  
  6. def create
  7. @username = params[:following][:username]
  8. password = params[:following][:password]
  9. @follower = params[:following][:follower]
  10. twitter = Twitter::Base.new(@username,password)
  11. #get a list of your followers
  12. followers = twitter.follower_ids
  13. #get the id of the follower you want to check
  14. twitter.user(@follower).id
  15. #returns wether that user was in your followers list
  16. @following = followers.include? follower_id
  17. end
  18.  
  19. end
Add Comment
Please, Sign In to add comment