diff --git a/src/plugins/country-content/country-content-en.hbs b/src/plugins/country-content/country-content-en.hbs index 7c84696bdf3..8c9bb3a394c 100644 --- a/src/plugins/country-content/country-content-en.hbs +++ b/src/plugins/country-content/country-content-en.hbs @@ -3,11 +3,11 @@ "title": "Country Content", "language": "en", "category": "Plugins", - "description": "A basic AjaxLoader wrapper that inserts AJAXed-in content based on a visitor's country as determined by freegeoip.app", + "description": "A basic AjaxLoader wrapper that inserts AJAXed-in content based on a visitor's country as determined by country.is", "tag": "country-content", "parentdir": "country-content", "altLangPrefix": "country-content", - "dateModified": "2020-09-10" + "dateModified": "2022-07-18" } ---

{{description}}

diff --git a/src/plugins/country-content/country-content-fr.hbs b/src/plugins/country-content/country-content-fr.hbs index 5774df29faa..bfb864d1152 100644 --- a/src/plugins/country-content/country-content-fr.hbs +++ b/src/plugins/country-content/country-content-fr.hbs @@ -3,11 +3,11 @@ "title": "Contenu par pays", "language": "fr", "category": "Plugiciels", - "description": "Un enveloppeur de AjaxLoader qui insère de contenu télécharger via AJAX. Le contenu est basée sur l'emplacement des visiteurs comme déterminé par freegeoip.app", + "description": "Un enveloppeur de AjaxLoader qui insère de contenu télécharger via AJAX. Le contenu est basée sur l'emplacement des visiteurs comme déterminé par country.is", "tag": "country-content", "parentdir": "country-content", "altLangPrefix": "country-content", - "dateModified": "2020-09-10" + "dateModified": "2022-07-18" } ---

{{description}}

diff --git a/src/plugins/country-content/country-content.js b/src/plugins/country-content/country-content.js index 0cbec272296..4fd574b9b98 100644 --- a/src/plugins/country-content/country-content.js +++ b/src/plugins/country-content/country-content.js @@ -65,12 +65,12 @@ var componentName = "wb-ctrycnt", // From https://github.com/aFarkas/webshim/blob/master/src/shims/geolocation.js#L89-L127 $.ajax( { - url: "https://freegeoip.app/json/", + url: "https://api.country.is/", dataType: "json", cache: true, success: function( data ) { if ( data ) { - countryCode = data.country_code; + countryCode = data.country; try { localStorage.setItem( "countryCode", countryCode ); } catch ( error ) { diff --git a/src/plugins/country-content/test.js b/src/plugins/country-content/test.js index 1d8d458326c..08cb60788e1 100644 --- a/src/plugins/country-content/test.js +++ b/src/plugins/country-content/test.js @@ -23,10 +23,10 @@ describe( "Country Content test suite", function() { before( function() { - // Stub the $.ajax method to return data.country_code = "CA" on success. + // Stub the $.ajax method to return data.country = "CA" on success. // This must be used instead of Sinon's fakeServer because the plugin uses // JSON-P for the request: https://sinonjs.org/docs/#json-p - stubs.ajax = sandbox.stub( $, "ajax" ).yieldsTo( "success", { country_code: "CA" } ); + stubs.ajax = sandbox.stub( $, "ajax" ).yieldsTo( "success", { country: "CA" } ); stubs.load = sandbox.stub( $.prototype, "load" ); // Clear out any previously saved country code @@ -57,7 +57,7 @@ describe( "Country Content test suite", function() { for ( ; i !== len && !isLookup; i += 1 ) { if ( args[ i ] instanceof Array ) { - isLookup = args[ i ].length && args[ i ][ 0 ].url === "https://freegeoip.app/json/"; + isLookup = args[ i ].length && args[ i ][ 0 ].url === "https://api.country.is/"; } } expect( isLookup ).to.equal( true );