This commit is contained in:
coulisse 2021-12-23 15:26:12 +00:00
parent ccab3fc220
commit abe4885ef3
10 changed files with 53 additions and 99 deletions

View File

@ -6,8 +6,9 @@ SPIDERWEB
[![Linux](https://svgshare.com/i/Zhy.svg)](https://svgshare.com/i/Zhy.svg)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
[![made-with-javascript](https://img.shields.io/badge/Made%20with-JavaScript-1f425f.svg)](https://www.javascript.com)
[https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white](https://jquery.com/)
- **Release:** v2.2-beta
- **Release:** v2.2
- **Author:** Corrado Gerbaldo - IU1BOW.
- **Mail:** <corrado.gerbaldo@gmail.com>
- **Licensing:** Gpl V3.0 see ["LICENSE"](LICENSE) file.
@ -19,10 +20,9 @@ The user could see 50 spots at time and filter them by band, spotter continent a
For this application I've used:
- **Bootstrap** for stylesheet CSS
- **Jquery** In the header you can find the link to MS link
- **jQuery** In the header you can find the link to MS link
- **qrz.com** For each callsing found you can click on lens and you'll see him on qrz.com
- **flag-icon-css** [https://github.com/lipis/flag-icon-css](https://github.com/lipis/flag-icon-css) I used it for show the country flags
- **cookie-bar.eu** I use it for cookie bar
- **ng3k.com** [ng3k.com](http://ng3k.com/misc/adxo.html) I used to get information about "Announced Dx Operations". Thanks to Bill/NG3K !!!
You can find my web site at [https://www.iu1bow.it](https://www.i1bow.it)
@ -93,7 +93,7 @@ foo@bar:~$ mv config.json.template config.json
then edit it and set the user and password of your database, the menu items, and other stuffs (callsign, mail address...).
There is also a specific parameter, named "enable_cq_filter" used to enable the CQ Zone filtering.
Othewhise, if you preferr, you could use an utility for edit your configuration and menu. Go in "script" folder and run ./config.sh
Othewhise, if you prefer, you could use an utility for edit your configuration and menu. Go in "script" folder and run ./config.sh
```console
foo@bar:~$ cd scripts

View File

@ -1,11 +1,12 @@
### Change log
Date: 19/12/2021
Release: v2.2-beta
Date: 23/12/2021
Release: v2.2
- amended country code of Curacao
- managed CTY.dat file for a more precise localization of callsign
- bootstrap upgraded to 5.1.3
- added UTC clock in menu bar
- added cookie consent banner
- updated flag-icon-css
___
Date: 04/12/2021
Release: v2.1

View File

@ -312,6 +312,8 @@ class prefix_table:
return data
#not found
data["country"]="unknown country"
data["iso"]="xx"
return data

View File

@ -23,8 +23,8 @@
<link rel="stylesheet" href="/static/css/style.min.css">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" as="style" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"></noscript>
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.1/css/flag-icon.min.css" as="style" integrity="sha512-RYqXH3Tn/sC/iuKrQ0idMEQFSU7HEuPpQDhd/kzsIkE/1WxG43RN2RGp9bx2sX/Gdh1G0Gn3zActuCHqE4t6rg==" crossorigin="anonymous" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.1/css/flag-icon.min.css"></noscript>
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/4.1.5/css/flag-icons.min.css" as="style" integrity="sha512-UwbBNAFoECXUPeDhlKR3zzWU3j8ddKIQQsDOsKhXQGdiB5i3IHEXr9kXx82+gaHigbNKbTDp3VY/G6gZqva6ZQ==" crossorigin="anonymous" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/4.1.5/css/flag-icons.min.css"></noscript>
<script src="static/js/load_css.min.js"></script>
@ -91,7 +91,7 @@
<span class="copyleft">&copy;</span> Copyleft:
<span id="copyDate"></span>
<a href="https://github.com/coulisse/spiderweb/" target="blank" rel="noopener">IU1BOW Spiderweb</a>
<span id="version">v2.2-beta</span>
<span id="version">v2.2</span>
</div>
</footer>
<script async src="static/js/clock.min.js"></script>
@ -115,7 +115,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">We use cookies</h5>
<h1 class="modal-title">We use cookies</h1>
</div>
<div class="modal-body">
<p>We use only technical cookies.</p>

View File

@ -1,5 +1,5 @@
/********************************************************************************
* Main javascript for all core functions of this application
* javascript used to popolate main table with spots
* ******************************************************************************/
var adxo_url='http://www.ng3k.com/misc/adxo.html'
@ -20,9 +20,6 @@ function findAdxo(adxo, callsign_to_find) {
};
};
};
function isNumeric(val) {
return /^-?\d+$/.test(val);
}
/**
* Build the table with the spot
*
@ -149,29 +146,30 @@ function isNumeric(n) {
*
* @param id {string} The html identifier used for filter
* @param param {string}the parameter for the query
* @param len {number} The maximum number of element that could be selected; use -1 if the filter permits a single selection
* @param qrystr {string} Th initial query string to be completed with the new filter
*/
function getSingleFilter(id,param,qrystr) {
try {
selectedFilter = document.getElementById(id).value;
var qryFilter='';
if (isNumeric(selectedFilter)) {
qryFilter= param+'='+selectedFilter;
};
if (qrystr && qryFilter) {
qrystr=qrystr.concat('&'.concat(qryFilter));
} else {
qrystr=qrystr.concat(qryFilter);
};
} catch (error) {
};
function getFilter(id,param,len,qrystr) {
selectedFilter = [].map.call(document.getElementById(id).selectedOptions, option => option.value);
var qryFilter ='';
if (selectedFilter.length < len || len == -1) {
qryFilter = selectedFilter.map(function(el, idx) {
if (el) {
return param+'='+ el;
} else {
return '';
};
}).join('&');
qrystr=qrystr.concat('&'.concat(qryFilter));
if (qrystr.substring(0,1) == '&') {
qrystr=qrystr.substring(1)
};
};
return qrystr;
};
/**
* Search / Filter cluster spot based on filter settings
* Gets the filter values, constructs the query parameter and
@ -179,60 +177,14 @@ try {
*/
function myTimer() {
var request = new XMLHttpRequest()
selectedBand = [].map.call(document.getElementById('band').selectedOptions, option => option.value);
selectedDEre = [].map.call(document.getElementById('de_re').selectedOptions, option => option.value);
selectedDXre = [].map.call(document.getElementById('dx_re').selectedOptions, option => option.value);
selectedMode = [].map.call(document.getElementById('mode').selectedOptions, option => option.value);
//construct query parameters
var qryBand='';
var qryAll='';
if (selectedBand.length < 14) {
qryBand= selectedBand.map(function(el, idx) {
return 'b=' + el;
}).join('&');
};
var qryDEre='';
if (selectedDEre.length < 7) {
qryDEre = selectedDEre.map(function(el, idx) {
return 'e=' + el;
}).join('&');
};
if (qryBand && qryDEre){
qryAll=qryBand.concat('&'.concat(qryDEre));
} else {
qryAll=qryBand.concat(qryDEre);
};
var qryDXre='';
if (selectedDXre.length< 7) {
qryDXre = selectedDXre.map(function(el, idx) {
return 'x=' + el;
}).join('&');
};
if (qryAll && qryDXre) {
qryAll=qryAll.concat('&'.concat(qryDXre));
} else {
qryAll=qryAll.concat(qryDXre);
};
var qryMode='';
if (selectedMode.length < 3) {
qryMode= selectedMode.map(function(el, idx) {
return 'm=' + el;
}).join('&');
};
if (qryAll && qryMode) {
qryAll=qryAll.concat('&'.concat(qryMode));
} else {
qryAll=qryAll.concat(qryMode);
};
qryAll=getSingleFilter('cqdeInput','qe',qryAll);
qryAll=getSingleFilter('cqdxInput','qx',qryAll);
qryAll=getFilter('band','b',14,qryAll);
qryAll=getFilter('de_re','e',7,qryAll);
qryAll=getFilter('dx_re','x',7,qryAll);
qryAll=getFilter('mode','m',3,qryAll);
qryAll=getFilter('cqdeInput','qe',-1,qryAll);
qryAll=getFilter('cqdxInput','qx',-1,qryAll);
// Open a new connection, using the GET request on the URL endpoint
var qryString='spotlist';

View File

@ -1 +1 @@
var adxo_url="http://www.ng3k.com/misc/adxo.html",qrz_url="https://www.qrz.com/db/";function findAdxo(e,t){if(e)for(var a=0;a<e.length;a++)if(e[a].callsign==t)return e[a]}function isNumeric(e){return/^-?\d+$/.test(e)}function buildHtmlTable(e,t,a,n){if(null!=t){var l=new Array,r=new Date,d="00"+r.getUTCDate();d=d.substring(d.length-2,d.length);var o="00"+(Number(r.getUTCMonth())+1);o=o.substring(o.length-2,o.length);var c=r.getUTCFullYear();dt_current=d+"/"+o+"/"+c,$(e).empty();for(var s=0;s<t.length;s++){l[s]=t[s].rowid;var i=$('<tr id="'+t[s].rowid+'"/>'),u=a.find(e=>e==t[s].rowid);null!=n?n==t[s].de?i=$('<tr id="'+t[s].rowid+'"/>'):n==t[s].dx&&(i=$('<tr id="'+t[s].rowid+'"/>')):null==u&&a.length>0&&(i=$('<tr class="table-info" id="'+t[s].rowid+'"/>')),t[s].de==n?de="<mark>"+t[s].de+"</mark>":de=t[s].de,i.append($("<td/>").html('<a href="'+qrz_url+t[s].de+'" target="_blank" rel="noopener"><i class="bi-search" role="button" aria-label="'+t[s].de+'"></i></a><span>&nbsp'+de+"</span></b>"));var p=Intl.NumberFormat("it-IT",{style:"decimal"}).format(t[s].freq);i.append($("<td/>").html('<span class="badge bg-warning text-dark badge-responsive">'+p+"</span>")),t[s].dx==n?dx="<mark>"+t[s].dx+"</mark>":dx=t[s].dx;var g=findAdxo(my_adxo_events,t[s].dx),m="<a href="+adxo_url+" target=_blank rel=noopener >NG3K Website</a>";null!=g&&(dx=dx+'&nbsp<i tabindex="0" class="bi-megaphone-fill" style="color: cornflowerblue; " role="button" aria-label="dx_operations" data-bs-container="body" data-bs-toggle="popover" data-bs-trigger="focus" data-bs-sanitize="true" data-bs-placement="auto" data-bs-html="true" data-bs-title="Announced DX Op.: '+g.summary+'" data-bs-content="'+g.description+" data from &nbsp"+m+'"></i>'),i.append($("<td/>").html('<a href="'+qrz_url+t[s].dx+'" target="_blank" rel="noopener"><i class="bi-search" role="button" aria-label="'+t[s].dx+'"></i></a><span>&nbsp'+dx+"</span>"));try{i.append($("<td/>").html('<span class="img-flag flag-icon flag-icon-'+t[s].iso+'" data-bs-container="body" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-placement="left" data-bs-content="'+t[s].country+'"></span>'))}catch(e){i.append($("<td/>"))}i.append($('<td class="d-none d-lg-table-cell d-xl-table-cell"/>').html(t[s].country)),i.append($('<td class="d-none d-lg-table-cell d-xl-table-cell"/>').html(t[s].comm));var b=new Date(1e3*t[s].time),h="00"+b.getUTCHours();h=h.substring(h.length-2,h.length);var f="00"+b.getMinutes();f=f.substring(f.length-2,f.length);var v="00"+b.getUTCDate();v=v.substring(v.length-2,v.length);var x="00"+(Number(b.getUTCMonth())+1);x=x.substring(x.length-2,x.length);var y=b.getUTCFullYear();tm=h+":"+f,(b=v+"/"+x+"/"+y)==dt_current?i.append($("<td/>").html(tm)):i.append($("<td/>").html('<table class="table-sm table-borderless"><tbody><tr style="background-color:transparent"><td>'+tm+"</td></tr><tr><td>"+b+"</td></tr></tbody></table>")),$(e).append(i)}$(function(){$('[data-bs-toggle="popover"]').popover({container:e})});try{return Array.from(l)}catch(e){return}}}function mySearch(e){e.preventDefault(),myTimer()}function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}function getSingleFilter(e,t,a){try{selectedFilter=document.getElementById(e).value;var n="";isNumeric(selectedFilter)&&(n=t+"="+selectedFilter),a=a&&n?a.concat("&".concat(n)):a.concat(n)}catch(e){}return a}function myTimer(){var e=new XMLHttpRequest;selectedBand=[].map.call(document.getElementById("band").selectedOptions,e=>e.value),selectedDEre=[].map.call(document.getElementById("de_re").selectedOptions,e=>e.value),selectedDXre=[].map.call(document.getElementById("dx_re").selectedOptions,e=>e.value),selectedMode=[].map.call(document.getElementById("mode").selectedOptions,e=>e.value);var t="",a="";selectedBand.length<14&&(t=selectedBand.map(function(e,t){return"b="+e}).join("&"));var n="";selectedDEre.length<7&&(n=selectedDEre.map(function(e,t){return"e="+e}).join("&")),a=t&&n?t.concat("&".concat(n)):t.concat(n);var l="";selectedDXre.length<7&&(l=selectedDXre.map(function(e,t){return"x="+e}).join("&")),a=a&&l?a.concat("&".concat(l)):a.concat(l);var r="";selectedMode.length<3&&(r=selectedMode.map(function(e,t){return"m="+e}).join("&")),a=getSingleFilter("cqdeInput","qe",a=a&&r?a.concat("&".concat(r)):a.concat(r));var d="spotlist";(a=getSingleFilter("cqdxInput","qx",a))&&(d=d.concat("?".concat(a))),e.open("GET",d,!0),e.onload=function(){try{rows_list=buildHtmlTable("#bodyspot",JSON.parse(this.response),rows_list)}catch(e){console.log(e),console.log(e.stack)}},e.send()}
var adxo_url="http://www.ng3k.com/misc/adxo.html",qrz_url="https://www.qrz.com/db/";function findAdxo(t,e){if(t)for(var a=0;a<t.length;a++)if(t[a].callsign==e)return t[a]}function buildHtmlTable(t,e,a,r){if(null!=e){var n=new Array,l=new Date,d="00"+l.getUTCDate();d=d.substring(d.length-2,d.length);var o="00"+(Number(l.getUTCMonth())+1);o=o.substring(o.length-2,o.length);var s=l.getUTCFullYear();dt_current=d+"/"+o+"/"+s,$(t).empty();for(var i=0;i<e.length;i++){n[i]=e[i].rowid;var c=$('<tr id="'+e[i].rowid+'"/>'),b=a.find(t=>t==e[i].rowid);null!=r?r==e[i].de?c=$('<tr id="'+e[i].rowid+'"/>'):r==e[i].dx&&(c=$('<tr id="'+e[i].rowid+'"/>')):null==b&&a.length>0&&(c=$('<tr class="table-info" id="'+e[i].rowid+'"/>')),e[i].de==r?de="<mark>"+e[i].de+"</mark>":de=e[i].de,c.append($("<td/>").html('<a href="'+qrz_url+e[i].de+'" target="_blank" rel="noopener"><i class="bi-search" role="button" aria-label="'+e[i].de+'"></i></a><span>&nbsp'+de+"</span></b>"));var g=Intl.NumberFormat("it-IT",{style:"decimal"}).format(e[i].freq);c.append($("<td/>").html('<span class="badge bg-warning text-dark badge-responsive">'+g+"</span>")),e[i].dx==r?dx="<mark>"+e[i].dx+"</mark>":dx=e[i].dx;var p=findAdxo(my_adxo_events,e[i].dx),u="<a href="+adxo_url+" target=_blank rel=noopener >NG3K Website</a>";null!=p&&(dx=dx+'&nbsp<i tabindex="0" class="bi-megaphone-fill" style="color: cornflowerblue; " role="button" aria-label="dx_operations" data-bs-container="body" data-bs-toggle="popover" data-bs-trigger="focus" data-bs-sanitize="true" data-bs-placement="auto" data-bs-html="true" data-bs-title="Announced DX Op.: '+p.summary+'" data-bs-content="'+p.description+" data from &nbsp"+u+'"></i>'),c.append($("<td/>").html('<a href="'+qrz_url+e[i].dx+'" target="_blank" rel="noopener"><i class="bi-search" role="button" aria-label="'+e[i].dx+'"></i></a><span>&nbsp'+dx+"</span>"));try{c.append($("<td/>").html('<span class="img-flag flag-icon flag-icon-'+e[i].iso+'" data-bs-container="body" data-bs-toggle="popover" data-bs-trigger="hover" data-bs-placement="left" data-bs-content="'+e[i].country+'"></span>'))}catch(t){c.append($("<td/>"))}c.append($('<td class="d-none d-lg-table-cell d-xl-table-cell"/>').html(e[i].country)),c.append($('<td class="d-none d-lg-table-cell d-xl-table-cell"/>').html(e[i].comm));var m=new Date(1e3*e[i].time),h="00"+m.getUTCHours();h=h.substring(h.length-2,h.length);var f="00"+m.getMinutes();f=f.substring(f.length-2,f.length);var x="00"+m.getUTCDate();x=x.substring(x.length-2,x.length);var v="00"+(Number(m.getUTCMonth())+1);v=v.substring(v.length-2,v.length);var y=m.getUTCFullYear();tm=h+":"+f,(m=x+"/"+v+"/"+y)==dt_current?c.append($("<td/>").html(tm)):c.append($("<td/>").html('<table class="table-sm table-borderless"><tbody><tr style="background-color:transparent"><td>'+tm+"</td></tr><tr><td>"+m+"</td></tr></tbody></table>")),$(t).append(c)}$(function(){$('[data-bs-toggle="popover"]').popover({container:t})});try{return Array.from(n)}catch(t){return}}}function mySearch(t){t.preventDefault(),myTimer()}function isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}function getFilter(t,e,a,r){selectedFilter=[].map.call(document.getElementById(t).selectedOptions,t=>t.value);var n="";return(selectedFilter.length<a||-1==a)&&(n=selectedFilter.map(function(t,a){return t?e+"="+t:""}).join("&"),"&"==(r=r.concat("&".concat(n))).substring(0,1)&&(r=r.substring(1))),r}function myTimer(){var t=new XMLHttpRequest,e="";e=getFilter("band","b",14,e),e=getFilter("de_re","e",7,e),e=getFilter("dx_re","x",7,e),e=getFilter("mode","m",3,e),e=getFilter("cqdeInput","qe",-1,e);var a="spotlist";(e=getFilter("cqdxInput","qx",-1,e))&&(a=a.concat("?".concat(e))),t.open("GET",a,!0),t.onload=function(){try{rows_list=buildHtmlTable("#bodyspot",JSON.parse(this.response),rows_list)}catch(t){console.log(t),console.log(t.stack)}},t.send()}

View File

@ -1,5 +1,5 @@
{
"name": "IU1BOW DXCluster v2.2-beta",
"name": "IU1BOW DXCluster v2.2",
"description": "DXCluser for ham radio by IU1BOW",
"short_name": "IU1BOW DX",
"theme_color": "#2196f3",

View File

@ -20,8 +20,8 @@
<link rel="stylesheet" href="/static/css/style.min.css">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" as="style" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"></noscript>
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.1/css/flag-icon.min.css" as="style" integrity="sha512-RYqXH3Tn/sC/iuKrQ0idMEQFSU7HEuPpQDhd/kzsIkE/1WxG43RN2RGp9bx2sX/Gdh1G0Gn3zActuCHqE4t6rg==" crossorigin="anonymous" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.1/css/flag-icon.min.css"></noscript>
<link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/4.1.5/css/flag-icons.min.css" as="style" integrity="sha512-UwbBNAFoECXUPeDhlKR3zzWU3j8ddKIQQsDOsKhXQGdiB5i3IHEXr9kXx82+gaHigbNKbTDp3VY/G6gZqva6ZQ==" crossorigin="anonymous" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/4.1.5/css/flag-icons.min.css"></noscript>
<script src="static/js/load_css.min.js"></script>
{% endblock head %}
</head>
@ -87,7 +87,7 @@
<span class="copyleft">&copy;</span> Copyleft:
<span id="copyDate"></span>
<a href="https://github.com/coulisse/spiderweb/" target="blank" rel="noopener">IU1BOW Spiderweb</a>
<span id="version">v2.2-beta</span>
<span id="version">v2.2</span>
</div>
</footer>
<script async src="static/js/clock.min.js"></script>
@ -114,7 +114,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">We use cookies</h5>
<h1 class="modal-title">We use cookies</h1>
</div>
<div class="modal-body">
<p>We use only technical cookies.</p>

View File

@ -84,7 +84,7 @@
<b>CQ De zone</b>
<div class="col">
<select class="form-select" aria-label="cqde" aria-decribedby="cqde" id="cqdeInput" >
<option selected>All</option>
<option value="" selected >All</option>
<option value="1" >1 - northwestern zone of NA</option>
<option value="2" >2 - northeastern zone of NA</option>
<option value="3" >3 - western zone of NA</option>
@ -133,7 +133,7 @@
<b>CQ Dx zone</b>
<div class="col">
<select class="form-select" aria-label="cqdx" aria-decribedby="cqdx" id="cqdxInput" >
<option selected>All</option>
<option value="" selected>All</option>
<option value="1" >1 - northwestern zone of NA</option>
<option value="2" >2 - northeastern zone of NA</option>
<option value="3" >3 - western zone of NA</option>
@ -192,7 +192,7 @@
<table id="spotsTable" class="table table-striped table-sm text-responsive table-borderless table-hover">
<thead>
<tr>
<th>DX De</th>
<th>DE</th>
<th>Freq</th>
<th>DX</th>
<th></th>

View File

@ -188,13 +188,12 @@ def spotquery():
search_prefix=pfxt.find(main_result["dx"])
# merge recordset and contry prefix
#payload.append({**main_result, **search_prefix})
try:
main_result["country"]=search_prefix["country"]
main_result["iso"]=search_prefix["iso"]
except KeyError:
main_result["country"]='Pirate country'
main_result["iso"]=''
print (main_result)
# try:
main_result["country"]=search_prefix["country"]
main_result["iso"]=search_prefix["iso"]
# except KeyError:
# main_result["country"]='Pirate country'
# main_result["iso"]=''
payload.append({**main_result})
return payload