public/js/application.js
// Search for the recommended events of performer
Search for the recommended events of performer
Search for the recommended events of performer
function searchFavPerformerEvents(performer_id) {
        try{
            $.ajax({ 
            url: 'https://api.seatgeek.com/2/recommendations', 
            type: 'GET',
            data: {
                "performers.id": performer_id,
                "geoip": true,
                "client_id": "NjQxNzM2MnwxNDgxNjQ2MjUx",
                "client_secret": "yJIfLxYsZj1mkHwc1LD9wExA-X8HGGWGHOkoOZlo"
            }, 
            success: function(result) {
                $('#favorite_results').empty();
                console.log('successfully called ajax for performer rec search!');
                if (result.length == 0) {
                    $('#favorite_results').append("<p>Sorry we could not find any performers with those keywords. Please try another search!</p>");
                }
                else {
                    displayFavEvents(result.recommendations)
                }
            },
            error: function(response){
                console.log(response);                
            },
            dataType: "json",
            });
            return false;
        } catch (e) {console.log(e.description);
        }
    }
function searchFavPerformerEvents ( performer_id ) { try { $ . ajax ( { url : 'https://api.seatgeek.com/2/recommendations' , type : 'GET' , data : { "performers.id" : performer_id , "geoip" : true , "client_id" : "NjQxNzM2MnwxNDgxNjQ2MjUx" , "client_secret" : "yJIfLxYsZj1mkHwc1LD9wExA-X8HGGWGHOkoOZlo" } , success : function ( result ) { $ ( '#favorite_results' ) . empty ( ) ; console . log ( 'successfully called ajax for performer rec search!' ) ; if ( result . length == 0 ) { $ ( '#favorite_results' ) . append ( "<p>Sorry we could not find any performers with those keywords. Please try another search!</p>" ) ; } else { displayFavEvents ( result . recommendations ) } } , error : function ( response ) { console . log ( response ) ; } , dataType : "json" , } ) ; return false ; } catch ( e ) { console . log ( e . description ) ; } }
Search for the recommended events of performer
Search for the recommended events of performer
// Display recommendations in HTML