Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "twitter"
- class MainController < ApplicationController
- def new
- end
- def create
- @username = params[:following][:username]
- password = params[:following][:password]
- @follower = params[:following][:follower]
- twitter = Twitter::Base.new(@username,password)
- #get a list of your followers
- followers = twitter.follower_ids
- #get the id of the follower you want to check
- twitter.user(@follower).id
- #returns wether that user was in your followers list
- @following = followers.include? follower_id
- end
- end
Add Comment
Please, Sign In to add comment