· 6 years ago · Nov 26, 2018, 02:52 PM
1get '/auth/:provider/callback' do
2
3 omniauth = request.env['omniauth.auth']
4 oauth_token = omniauth['credentials']['token']
5
6 @@client = Foursquare2::Client.new(:oauth_token => oauth_token, :ssl => { :verify => OpenSSL::SSL::VERIFY_PEER, :ca_file => "/opt/local/etc/openssl/ca-bundle.crt" })
7
8
9
10
11
12 erb "<form method=POST> Enter limit:<input type=text name=lim>
13 <input type=submit value=Check friends!>
14 </form>"
15
16
17
18
19
20
21
22 end
23
24 post '/auth/:provider/callback' do
25
26
27
28
29 erb "<p> #{@@client.user_friends('self', options = {:limit => :lim }) } </p>"
30 end