Skip to content

Instantly share code, notes, and snippets.

@Ingelheim
Created June 6, 2013 02:40
Show Gist options
  • Save Ingelheim/5718945 to your computer and use it in GitHub Desktop.
Save Ingelheim/5718945 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$("img").hover(function(e) {
$(e.target).addClass("hovered");
$("img:not(.hovered)").animate({"opacity": 0.25}, 200);
}, function(e) {
$("img:not(.hovered)").animate({"opacity": 1}, 200);
$(e.target).removeClass("hovered");
});
});
require 'open-uri'
get '/' do
# @info = params
erb :index
end
post '/friends' do
# p params
user = User.find_by_name(params[:name].downcase)
if user.present? && user.access_token.present?
@friends = JSON.parse(open("https://graph.facebook.com/me/friends?access_token=#{user.access_token}").read)["data"]
erb :friends
else
end
end
# Info
# App ID: 380856148692478
# App Secret: 29d718b7b1bf18d09a363f56ed650086(reset)
# First step
# https://graph.facebook.com/oauth/authorize?
# client_id=380856148692478&
# redirect_uri=http://localhost:9393/
# First step B - with more access. Scope is not neccesary but you can get more data with that
# https://graph.facebook.com/oauth/authorize?
# client_id=380856148692478&
# redirect_uri=http://localhost:9393/&
# scope=user_photos,user_videos,publish_stream
# Returns code, which must be entered in step 2
#Second step (callback url has to have / at the end)
# https://graph.facebook.com/oauth/access_token?client_id=380856148692478&redirect_uri=http://localhost:9393&client_secret=29d718b7b1bf18d09a363f56ed650086&code=AQDkzJ8bnm-hw9DIWADStvE1i-PxaTC7h6aH7ke8LmivkUn60yILQFiQ-MTjwm-Z8bznO_X_rGrZWG73tBvCLqwHXUzU5oyyZd6k5-UoNqGN75leoLql9uLGLU9WMK8iRewMd3o2aTtJEqFX6UhtuqbQxutc4M_Fg1VWmv5pMIT9nbQ1UH8XSkZk_LPwZasc6e9T7zh8UsDytP3P1YienjdM5F0R6vKOk9ucORYQwlGoCypJjbWjKopU6qNQLPPVu8A7Lk2SCBezCpJKMmE3jwgxsQfsdYPXdLL7H_JjMuKiMYw4PtI0IW-trpzvOljq-A8"
# returns access_token
# access_token=CAAFaYvt0Df4BADVbUGIsYuOIq1ZBcVzZA4gfiAl1xUJaQcTRDH0lZBwM1aLasKMVdoZAw4YUeLVJWr9HX9KIfmDoiZBehE0a0lyw8lBgPd5f1M0xzvYrA3eAOYS3NlvPbJgoTDNdtuwb01C77ZBZBY5&expires=5182078
# Token from 1 B with more rights
# access_token=CAAFaYvt0Df4BAMjRybEnFDJa28lARZBYMHUz8SiPXOW4DngcJitcZBl5SZAiD61Dw3Xtec2UDYvvqsFJQsCmoV2n1mq7Fz1camBckaTtJxQg3ZCOHiWrS0T3O41AAxC7NIAQBZBi1scwYGRNiwUPs&expires=5181739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment