Adds Mullvad and IP blacklist check widgets

This commit is contained in:
Alicia Sykes
2022-04-14 19:02:51 +01:00
parent a6f3c90722
commit 4c713bfce6
9 changed files with 337 additions and 3 deletions

View File

@@ -46,6 +46,12 @@ export const timestampToDateTime = (timestamp) => {
return `${timestampToDate(timestamp)} at ${timestampToTime(timestamp)}`;
};
/* Given a 2-letter country ISO code, return the countries name */
export const getCountryFromIso = (iso) => {
const regionNames = new Intl.DisplayNames(['en'], { type: 'region' });
return regionNames.of(iso);
};
/* Given a 2-digit country code, return path to flag image from Flagpedia */
export const getCountryFlag = (countryCode, dimens) => {
const protocol = 'https';

View File

@@ -209,6 +209,7 @@ module.exports = {
widgetApiEndpoints: {
anonAddy: 'https://app.anonaddy.com',
astronomyPictureOfTheDay: 'https://apodapi.herokuapp.com/api',
blacklistCheck: 'https://api.blacklistchecker.com/check',
codeStats: 'https://codestats.net/',
covidStats: 'https://disease.sh/v3/covid-19',
cryptoPrices: 'https://api.coingecko.com/api/v3/coins/',
@@ -223,6 +224,7 @@ module.exports = {
holidays: 'https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForDateRange',
jokes: 'https://v2.jokeapi.dev/joke/',
news: 'https://api.currentsapi.services/v1/latest-news',
mullvad: 'https://am.i.mullvad.net/json',
publicIp: 'https://ipapi.co/json',
publicIp2: 'https://api.ipgeolocation.io/ipgeo',
publicIp3: 'http://ip-api.com/json',