<commit_before>require 'omniauth-oauth'
require 'multi_json'

module OmniAuth
  module Strategies

    class FiveColleges < OmniAuth::Strategies::OAuth
      
      option :name, 'fivecolleges'
      
      option :client_options, {
        :access_token_path => "/v1/oauth/access_token",
        :authorize_path => "/v1/oauth/authorize",
        :request_token_path => "/v1/oauth/request_token",
        :site => "https://api.500px.com"
      }
      
      uid { 
        user_info['id']
      }
      
      info do 
        {
          :nickname => user_info['username'],
          :email => user_info['email'],
          :name => user_info['fullname'],
          :first_name => user_info['firstname'],
          :last_name => user_info['lastname'],
          :description => user_info['about'],
          :image => user_info['userpic_url'],
          :urls => {
            '500px' => user_info['domain'],
            'Website' => user_info['contacts']['website']
          }
        }
      end
      
      extra do
        {
          :raw_info => raw_info
        }
      end

      # Return info gathered from the flickr.people.getInfo API call 
     
      def raw_info
        @raw_info ||= MultiJson.decode(access_token.get('/v1/users.json').body)<commit_msg>fixed incorrect URIs<commit_after>require 'omniauth-oauth'
require 'multi_json'

module OmniAuth
  module Strategies

    class FiveColleges < OmniAuth::Strategies::OAuth
      
      option :name, 'fivecolleges'
      
      option :client_options, {
        :access_token_path => "/oauth/access_token",
        :authorize_path => "/oauth/authorize",
        :request_token_path => "/oauth/request_token",
        :site => "https://www.ats.amherst.edu"
      }
      
      uid { 
        user_info['id']
      }
      
      info do 
        {
          :email => user_info['email'],
          :name => user_info['fullname'],
          :id => user_info['id'],
        }
      end
      
      extra do
        {
          :raw_info => raw_info
        }
      end

      # Return info gathered from the flickr.people.getInfo API call 
     
      def raw_info
        @raw_info ||= MultiJson.decode(access_token.get('/oauth/user_profile').body)
{'fraction_non_alphanumeric': 0.12759242560865644, 'fraction_numerical': 0.004508566275924256, 'mean_word_length': 1.8893229166666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1676414', 'n_tokens_mistral': 702, 'n_tokens_neox': 682, 'n_words': 118}