Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 7 in /var/www/html/microblog/wp-content/themes/p2-fork/inc/mentions.php on line 77

URLをカード化するブックマークレット、案外サムネが取得できないので、フォールバックとして favicon.ico を取得するように修正してみた。


javascript:void%20function(){void%20function(){(function(){function%20t(t){return%20String(t).replace(/[%26%3C%3E%22'`=\/%20\t\n]/g,function(t){return%20r[t]%3Fr[t]:t})}var%20e=window.location.href,o=document.querySelector(%22title%22).innerText,n=%22%22,i=document.querySelector(%22meta[property='og:description']%22);i%3Fn=i.getAttribute(%22content%22):(i=document.querySelector(%22meta[name='description']%22),n=i%3Fi.getAttribute(%22content%22):document.querySelector(%22body%22).textContent);var%20r={%22%26%22:%22%26amp;%22,%22%3C%22:%22%26lt;%22,%22%3E%22:%22%26gt;%22,'%22':%22%26quot;%22,%22'%22:%22%26%2339;%22,%22/%22:%22%26%23x2F;%22,%22`%22:%22%26%23x60;%22,%22=%22:%22%26%23x3D;%22,%22%20%20%20%22:%22%20%22,%22\r%22:%22%22,%22\n%22:%22%22};n%26%26(n=n.substring(0,70)+%22...%22,n=t(n),n=n.split(/[%20\t\n]+/g).join(%22%20%22));var%20a=%22%22,l=document.querySelector(%22meta[property='og:image']%22),c=document.querySelector(%22link[rel='shortcut%20icon']%22);l%26%26(a=l.getAttribute(%22content%22))||c%26%26(a=c.getAttribute(%22href%22).replace(/^\//,window.location.protocol+%22//%22+window.location.host+%22/%22)),0==a.length%26%26(a=%22%22);var%20d='%3Cdiv%20class=%22cardlet-box%22%20style=%22margin-bottom:0px;%22%3E%3Cdiv%20class=%22cardlet-image%22%20style=%22float:left;margin:0px%2012px%201px%200px;%22%3E%3Ca%20href=%22'+e+'%22%20name=%22amazletlink%22%20target=%22_blank%22%3E'+(a.length%3E0%3F'%3Cimg%20src=%22'+a+'%22%20alt=%22'+o+'%22%20style=%22border:%20none;width:50px;max-height:100px;%22%20/%3E':'%3Cspan%20class=%22cardlet-no-image%22%20style=%22display:inline-block;width:50px;height:50px;background:%23efefef;%22%3E%3C/span%3E')+'%3C/a%3E%3C/div%3E%3Cdiv%20class=%22cardlet-info%22%20style=%22line-height:120%25;%20margin-bottom:%2010px%22%3E%3Cdiv%20class=%22cardlet-name%22%20style=%22margin-bottom:10px;line-height:120%25%22%3E%3Ca%20href=%22'+e+'%22%20name=%22amazletlink%22%20target=%22_blank%22%3E'+o+'%3C/a%3E%3C/div%3E%3Cdiv%20class=%22cardlet-detail%22%20style=%22color:%20%23909090;%22%3E'+n+'%3C/div%3E%3Cdiv%20class=%22cardlet-footer%22%20style=%22clear:%20left%22%3E%3C/div%3E%3C/div%3E%3C/div%3E';prompt(%22Copy%20to%20clipboard:%22,d)})()}()}();