1
0
Fork 0
mirror of https://github.com/matomo-org/matomo-icons.git synced 2024-09-19 17:03:45 +02:00

search for favicon with BeautifulSoup

This commit is contained in:
Lukas Winkler 2016-12-23 15:19:57 +01:00
parent d933c3d840
commit 7befcb9603
22 changed files with 2381 additions and 1 deletions

View file

@ -1,8 +1,10 @@
import shutil
import sys
import urllib.parse
import requests
import yaml
from bs4 import BeautifulSoup
MODE = "socials"
@ -54,7 +56,17 @@ for i, element in search_engines.items():
offline = True
if not offline:
r = requests.get("http://" + url + "/favicon.ico", stream=True)
soup = BeautifulSoup(r.content, "html.parser")
favicon_element = soup.find("link", rel="shortcut icon")
if not favicon_element:
favicon_path = "/favicon.ico"
else:
favicon_path = favicon_element['href']
print(favicon_path)
# Works with relative and absolute favicon_paths:
favicon_url = urllib.parse.urljoin("http://" + url, favicon_path)
print(favicon_url)
r = requests.get(favicon_url, stream=True)
if r.status_code == 200:
with open(outputdir + url + ".ico", 'wb') as f:
r.raw.decode_content = True

View file

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><link rel="manifest" href="/manifest.json"><link rel="apple-touch-icon" sizes="57x57" href="./assets/favicon/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="./assets/favicon/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="./assets/favicon/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="./assets/favicon/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="./assets/favicon/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="./assets/favicon/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="./assets/favicon/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="./assets/favicon/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="./assets/favicon/apple-touch-icon-180x180.png"><link rel="icon" type="image/png" href="./assets/favicon/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="./assets/favicon/favicon-194x194.png" sizes="194x194"><link rel="icon" type="image/png" href="./assets/favicon/favicon-96x96.png" sizes="96x96"><link rel="icon" type="image/png" href="./assets/favicon/android-chrome-192x192.png" sizes="192x192"><link rel="icon" type="image/png" href="./assets/favicon/favicon-16x16.png" sizes="16x16"><link rel="shortcut icon" href="./assets/favicon/favicon.ico"><title>Bebo: HQ For Your Group</title><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="Your group's headquarters. Bring all your communication together in 1 place with text, photo, video, & more"><meta property="twitter:card" content="summary_large_image"><meta property="twitter:site" content="@bebo_official"><meta property="twitter:title" content="HQ For Your Group"><meta property="twitter:creator" content="@bebo_official"><meta property="twitter:description" content="The place for your group to hangout"><meta property="twitter:image" content="/assets/img/bebo-card.png?t=1475175463"><meta property="og:url" content="https://bebo.com"><meta property="og:site_name" content="bebo.com"><meta property="og:title" content="The place for your group to hangout"><meta property="og:image" content="/assets/img/bebo-card.png"><meta property="og:type" content="product"><meta property="apple-itunes-app" content="app-id=943549087"><link href="https://fonts.googleapis.com/css?family=Lato:400,700|Montserrat:400,700" rel="stylesheet"><style>.initial-load-container{position:fixed;top:0;right:0;left:0;bottom:0;background:#121212}.loader{position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-50px;width:100px;text-align:center;font-size:1.2em;color:#555}.circle1{-webkit-animation:bounce linear 2.2s infinite forwards;animation:bounce linear 2.2s infinite forwards;-webkit-animation-delay:0;animation-delay:0}.circle2{-webkit-animation:bounce linear 2.2s infinite forwards;animation:bounce linear 2.2s infinite forwards;-webkit-animation-delay:125ms;animation-delay:125ms}.circle3{-webkit-animation:bounce linear 2.2s infinite forwards;animation:bounce linear 2.2s infinite forwards;-webkit-animation-delay:250ms;animation-delay:250ms}.circle4{-webkit-animation:bounce linear 2.2s infinite forwards;animation:bounce linear 2.2s infinite forwards;-webkit-animation-delay:375ms;animation-delay:375ms}@keyframes bounce{0%,100%{transform:translateY(0)}20%,50%{transform:translateY(9px)}80%{transform:translateY(2px)}40%{transform:translateY(-15px)}60%{transform:translateY(-7px)}}</style><link href="/static/css/main.dcc1fe88.css" rel="stylesheet"></head><body><div id="app"><div class="initial-load-container"><div class="loader"><svg version="1.1" id="Layer_1"><circle class="circle1" fill="#fe1263" cx="13.5" cy="22.5" r="4.5"/><circle class="circle2" fill="#fe1263" cx="31.5" cy="22.5" r="4.5"/><circle class="circle3" fill="#fe1263" cx="49.5" cy="22.5" r="4.5"/><circle class="circle4" fill="#fe1263" cx="67.5" cy="22.5" r="4.5"/></svg></div></div></div><script>!function(e,t,a,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=t.createElement(a),s=t.getElementsByTagName(a)[0],o.async=1,o.src=n,s.parentNode.insertBefore(o,s)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga"),ga("create","UA-78647206-2","auto"),ga("send","pageview")</script><script src="/static/js/opentok.min.js?t=1475175463"></script><script type="text/javascript" src="/static/js/main.2bbc13cb.js"></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -0,0 +1,11 @@
<html><head>
<title></title></head>
<!-- Redirection Services sjl0vlredir03 -->
<frameset rows='100%, *' frameborder=no framespacing=0 border=0>
<frame src="http://67.217.169.119/favicon.ico" name=mainwindow frameborder=no framespacing=0 marginheight=0 marginwidth=0></frame>
</frameset>
<noframes>
<h2>Your browser does not support frames. We recommend upgrading your browser.</h2><br><br>
<center>Click <a href="http://67.217.169.119/favicon.ico">here</a> to enter the site.</center>
</noframes></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,46 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function getCookie(c_name) { // Local function for getting a cookie value
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start!=-1) {
c_start=c_start + c_name.length + 1;
c_end=document.cookie.indexOf(";", c_start);
if (c_end==-1)
c_end = document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
function setCookie(c_name, value, expiredays) { // Local function for setting a value of a cookie
var exdate = new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/";
}
function getHostUri() {
var loc = document.location;
return loc.toString();
}
setCookie('YPF8827340282Jdskjhfiw_928937459182JAX666', '194.96.24.180', 10);
try {
location.reload(true);
} catch (err1) {
try {
location.reload();
} catch (err2) {
location.href = getHostUri();
}
}
</script>
</head>
<body>
<noscript>This site requires JavaScript and Cookies to be enabled. Please change your browser settings or upgrade your browser.</noscript>
</body>
</html>

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 108 KiB