Skip to main content
stack snippet added
Source Link
rene
  • 2.8k
  • 2
  • 17
  • 35

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of JavaScript to demonstrate the effect of the missing url: (if we only had Stack Snippets here: oh wait Should we enable Stack Snippets?)

function headUrl(propname, url) {
  var tab = document.getElementById('imglist')
  var tr = document.createElement('tr');
  var tdProp = document.createElement('td');
  var tdUrl = document.createElement('td');
  var tdImg = document.createElement('td');
  var img = document.createElement('img');
  img.src = url;
  tdImg.appendChild(img);
  tdUrl.textContent = url;
  tdProp.textContent = propname;
  tr.appendChild(tdProp);
  tr.appendChild(tdUrl);
  tr.appendChild(tdImg);
  tab.appendChild(tr);
}

document.body.appendChild(document.createElement('div'));
var tab = document.createElement('table');
tab.id='imglist';
document.body.appendChild(tab);
document.styleSheets[0].insertRule('td{border:solid black 1px; margin:0px; padding:4px;}');
document.getElementsByTagName('div')[0].textContent = 'loading ...';

fetch('https://api.stackexchange.com/2.3/sites?pagesize=500')
  .then((resp) =>  {
     if (resp.ok) {
      document.getElementsByTagName('div')[0].textContent = 'get response ...';
      return resp.json();
     } else {
       document.getElementsByTagName('div')[0].textContent = 'error ...';
     }
  })
  .then((json) => {
    var i, site;
    document.getElementsByTagName('div')[0].textContent = 'processing ...';
    for(i = 0; i< json.items.length; i++) {
      site = json.items[i];
      if (site.name.indexOf('Area')>-1) {
        document.getElementsByTagName('div')[0].textContent = 'get response ...';
        for(var prop in site) {
          if (prop.endsWith('_url')) {
            var url = site[prop];
            if (url!== 'https://area51.meta.stackexchange.com') {
              headUrl(prop, url);
            }
          }
        }
      }
    }
    document.getElementsByTagName('div')[0].textContent = 'ready ...';
   });

function addRowToImageTable(propname, url) {
  var tab = document.getElementById('imglist')
  var tr = document.createElement('tr');
  var tdProp = document.createElement('td');
  var tdUrl = document.createElement('td');
  var tdImg = document.createElement('td');
  var img = document.createElement('img');
  img.src = url;
  tdImg.appendChild(img);
  tdUrl.textContent = url;
  tdProp.textContent = propname;
  tr.appendChild(tdProp);
  tr.appendChild(tdUrl);
  tr.appendChild(tdImg);
  tab.appendChild(tr);
}

function addStatusDiv() {
  var status = document.createElement('div');
  status.id = 'status';
  document.body.appendChild(status);
}

function addTableForImagesToBody() {
  var tab = document.createElement('table');
  tab.id='imglist';
  document.body.appendChild(tab);
  document.styleSheets[0].insertRule('td{border:solid black 1px; margin:0px; padding:4px;}');
  document.getElementsByTagName('div')[0].textContent = 'loading ...';
}

function showStatus(txt) {
  var status = document.getElementById('status');
  status.textContent = txt;
}

addStatusDiv();
addTableForImagesToBody();

fetch('https://api.stackexchange.com/2.3/sites?pagesize=500')
  .then((resp) =>  {
     if (resp.ok) {
      showStatus('get response ...');
      return resp.json();
     } else {
       showStatus('error ...');
     }
  })
  .then((json) => {
    var i, site;
    showStatus('processing ...');
    for(i = 0; i< json.items.length; i++) {
      site = json.items[i];
      if (site.name.indexOf('Area')>-1) {
        showStatus('process single item ...');
        for(var prop in site) {
          if (prop.endsWith('_url') && prop !== 'site_url') {
            var url = site[prop];
            addRowToImageTable(prop, url);
          }
        }
      }
    }
    showStatus('ready ...');
   });
td {
  border:solid black 1px; 
  margin:0px; 
  padding:4px;
}

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of JavaScript to demonstrate the effect of the missing url: (if we only had Stack Snippets here: oh wait Should we enable Stack Snippets?)

function headUrl(propname, url) {
  var tab = document.getElementById('imglist')
  var tr = document.createElement('tr');
  var tdProp = document.createElement('td');
  var tdUrl = document.createElement('td');
  var tdImg = document.createElement('td');
  var img = document.createElement('img');
  img.src = url;
  tdImg.appendChild(img);
  tdUrl.textContent = url;
  tdProp.textContent = propname;
  tr.appendChild(tdProp);
  tr.appendChild(tdUrl);
  tr.appendChild(tdImg);
  tab.appendChild(tr);
}

document.body.appendChild(document.createElement('div'));
var tab = document.createElement('table');
tab.id='imglist';
document.body.appendChild(tab);
document.styleSheets[0].insertRule('td{border:solid black 1px; margin:0px; padding:4px;}');
document.getElementsByTagName('div')[0].textContent = 'loading ...';

fetch('https://api.stackexchange.com/2.3/sites?pagesize=500')
  .then((resp) =>  {
     if (resp.ok) {
      document.getElementsByTagName('div')[0].textContent = 'get response ...';
      return resp.json();
     } else {
       document.getElementsByTagName('div')[0].textContent = 'error ...';
     }
  })
  .then((json) => {
    var i, site;
    document.getElementsByTagName('div')[0].textContent = 'processing ...';
    for(i = 0; i< json.items.length; i++) {
      site = json.items[i];
      if (site.name.indexOf('Area')>-1) {
        document.getElementsByTagName('div')[0].textContent = 'get response ...';
        for(var prop in site) {
          if (prop.endsWith('_url')) {
            var url = site[prop];
            if (url!== 'https://area51.meta.stackexchange.com') {
              headUrl(prop, url);
            }
          }
        }
      }
    }
    document.getElementsByTagName('div')[0].textContent = 'ready ...';
   });

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of JavaScript to demonstrate the effect of the missing url:

function addRowToImageTable(propname, url) {
  var tab = document.getElementById('imglist')
  var tr = document.createElement('tr');
  var tdProp = document.createElement('td');
  var tdUrl = document.createElement('td');
  var tdImg = document.createElement('td');
  var img = document.createElement('img');
  img.src = url;
  tdImg.appendChild(img);
  tdUrl.textContent = url;
  tdProp.textContent = propname;
  tr.appendChild(tdProp);
  tr.appendChild(tdUrl);
  tr.appendChild(tdImg);
  tab.appendChild(tr);
}

function addStatusDiv() {
  var status = document.createElement('div');
  status.id = 'status';
  document.body.appendChild(status);
}

function addTableForImagesToBody() {
  var tab = document.createElement('table');
  tab.id='imglist';
  document.body.appendChild(tab);
  document.styleSheets[0].insertRule('td{border:solid black 1px; margin:0px; padding:4px;}');
  document.getElementsByTagName('div')[0].textContent = 'loading ...';
}

function showStatus(txt) {
  var status = document.getElementById('status');
  status.textContent = txt;
}

addStatusDiv();
addTableForImagesToBody();

fetch('https://api.stackexchange.com/2.3/sites?pagesize=500')
  .then((resp) =>  {
     if (resp.ok) {
      showStatus('get response ...');
      return resp.json();
     } else {
       showStatus('error ...');
     }
  })
  .then((json) => {
    var i, site;
    showStatus('processing ...');
    for(i = 0; i< json.items.length; i++) {
      site = json.items[i];
      if (site.name.indexOf('Area')>-1) {
        showStatus('process single item ...');
        for(var prop in site) {
          if (prop.endsWith('_url') && prop !== 'site_url') {
            var url = site[prop];
            addRowToImageTable(prop, url);
          }
        }
      }
    }
    showStatus('ready ...');
   });
td {
  border:solid black 1px; 
  margin:0px; 
  padding:4px;
}

edited body
Source Link
Glorfindel
  • 6.9k
  • 3
  • 22
  • 49

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of javascriptJavaScript to demonstrate the effect of the missing url: (if we only had Stack Snippets here: oh wait Should we enable Stack Snippets?)

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of javascript to demonstrate the effect of the missing url: (if we only had Stack Snippets here: oh wait Should we enable Stack Snippets?)

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of JavaScript to demonstrate the effect of the missing url: (if we only had Stack Snippets here: oh wait Should we enable Stack Snippets?)

Source Link
rene
  • 2.8k
  • 2
  • 17
  • 35

high_resolution_icon_url points to a non-existing image for Area 51 Discuss

In 2013 this bug was reported: Not all sites are returning Hi Res icons

Since then a lot has improved. Most urls found in high_resolution_icon_url on the site type as returned by the /sites endpoint now return proper images.

Except one. Poor Meta of Area 51 is still unloved. Here is a piece of javascript to demonstrate the effect of the missing url: (if we only had Stack Snippets here: oh wait Should we enable Stack Snippets?)

function headUrl(propname, url) {
  var tab = document.getElementById('imglist')
  var tr = document.createElement('tr');
  var tdProp = document.createElement('td');
  var tdUrl = document.createElement('td');
  var tdImg = document.createElement('td');
  var img = document.createElement('img');
  img.src = url;
  tdImg.appendChild(img);
  tdUrl.textContent = url;
  tdProp.textContent = propname;
  tr.appendChild(tdProp);
  tr.appendChild(tdUrl);
  tr.appendChild(tdImg);
  tab.appendChild(tr);
}

document.body.appendChild(document.createElement('div'));
var tab = document.createElement('table');
tab.id='imglist';
document.body.appendChild(tab);
document.styleSheets[0].insertRule('td{border:solid black 1px; margin:0px; padding:4px;}');
document.getElementsByTagName('div')[0].textContent = 'loading ...';

fetch('https://api.stackexchange.com/2.3/sites?pagesize=500')
  .then((resp) =>  {
     if (resp.ok) {
      document.getElementsByTagName('div')[0].textContent = 'get response ...';
      return resp.json();
     } else {
       document.getElementsByTagName('div')[0].textContent = 'error ...';
     }
  })
  .then((json) => {
    var i, site;
    document.getElementsByTagName('div')[0].textContent = 'processing ...';
    for(i = 0; i< json.items.length; i++) {
      site = json.items[i];
      if (site.name.indexOf('Area')>-1) {
        document.getElementsByTagName('div')[0].textContent = 'get response ...';
        for(var prop in site) {
          if (prop.endsWith('_url')) {
            var url = site[prop];
            if (url!== 'https://area51.meta.stackexchange.com') {
              headUrl(prop, url);
            }
          }
        }
      }
    }
    document.getElementsByTagName('div')[0].textContent = 'ready ...';
   });

The image url found in high_resolution_icon_url is https://cdn.sstatic.net/Sites/area51discuss/Img/[email protected] but visiting that url is a 404.

Can you ask a designer to produce an image that can be served from that url?