<commit_before>var wikiResponse = {};
var wikipedia  = {

    initialize: function(data) {
        this.addPlaceToMap = data.addPlaceToMap;

    },
    search: function(term) {

       // var url = 'http://en.wikipedia.org/w/api.php?action=query&titles=Main%20Page&prop=revisions&rvprop=content&format=json';

        //var url = 'http://en.wikipedia.org/w/api.php?action=query&titles=' +
        //var url = 'http://en.wikipedia.org/w/api.php?action=parse&section=0&prop=text&page=' +
        var url = ' http://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=' +
            encodeURIComponent(term);
            //+ '&format=json';//&prop=revisions&rvprop=content

        //'/w/api.php?action=query&list=allpages&prop=info&format=json&apfrom=Hamburg';
        $.ajax( {
            url: url,
            //data: queryData,
            dataType: 'jsonp',
            jsonp: 'callback',
            crossDomain: true,
            type: 'POST',
            headers: { 'Api-User-Agent': 'udacity-course/1.0' }
        }).done(function(data) {
            //console.log('wikipedia');
            //console.log(data);
            wikiResponse = data;
            var pages = data.query.pages;
            for(var index in pages) {
                if(pages.hasOwnProperty(index)) {
                    console.log(pages[index].extract);
                }
            }
        }).fail(function() {
            console.log('wikipedia failed');
        });
    }
};<commit_msg>Add Wikipedia marker<commit_after>var wikiResponse = {};
var wikipedia  = {

    initialize: function(data) {
        this.addPlaceToMap = data.addPlaceToMap;

    },
    search: function(term) {

       // var url = 'http://en.wikipedia.org/w/api.php?action=query&titles=Main%20Page&prop=revisions&rvprop=content&format=json';

        //var url = 'http://en.wikipedia.org/w/api.php?action=query&titles=' +
        //var url = 'http://en.wikipedia.org/w/api.php?action=parse&section=0&prop=text&page=' +
        var url = ' http://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=' +
            encodeURIComponent(term);
            //+ '&format=json';//&prop=revisions&rvprop=content

        //'/w/api.php?action=query&list=allpages&prop=info&format=json&apfrom=Hamburg';
        $.ajax( {
            url: url,
            //data: queryData,
            dataType: 'jsonp',
            jsonp: 'callback',
            crossDomain: true,
            type: 'POST',
            headers: { 'Api-User-Agent': 'udacity-course/1.0' }
        }).done(function(data) {
            wikiResponse = data;
            var pages = data.query.pages;
            for(var index in pages) {
                if(pages.hasOwnProperty(index)) {
                    console.log(pages[index].extract);
                    var extract = pages[index].extract;
                    var place = new Place({
                        name: extract,
                        address: term,
                        icon: 'icon/pyramid.png' // TODO: Yelp Icon
                    });

                    googleMaps.updateLatLng(place, function(updatedPlace) {
                        googleMaps.createMarker(updatedPlace);
                    })
                }
            }
        }).fail(function() {
            console.log('Wikipedia search for term "' + term + '" failed');
        });
    }
};
{'fraction_non_alphanumeric': 0.15219941348973606, 'fraction_numerical': 0.002932551319648094, 'mean_word_length': 1.8190082644628098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2796931', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1000, 'n_words': 139}