add icons for referrers (searchEngines and socials)
TODO: Parse html to find favicon in custom path
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
||||||
*.log
|
*.log
|
||||||
vendor/
|
vendor/
|
||||||
tmp
|
tmp
|
||||||
|
finished.txt
|
||||||
|
|
19
analyseIco.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
file = sys.argv[1]
|
||||||
|
|
||||||
|
output = subprocess.check_output("identify " + file, shell=True)
|
||||||
|
icons = output.splitlines()
|
||||||
|
|
||||||
|
regex = b"\d+x\d+"
|
||||||
|
maxsize = 0
|
||||||
|
maxpos = 0
|
||||||
|
for i, icon in enumerate(icons):
|
||||||
|
resolution = re.findall(regex, icon)[0].decode() # e.g. 16x16
|
||||||
|
size = int(resolution.split("x")[0]) # e.g. 16
|
||||||
|
if size >= maxsize:
|
||||||
|
maxsize = size
|
||||||
|
maxpos = i
|
||||||
|
print(maxpos)
|
5
composer.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"piwik/searchengine-and-social-list": "^1.3"
|
||||||
|
}
|
||||||
|
}
|
40
composer.lock
generated
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "db041c0dc9f99f4a36466c5d5fff4493",
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "piwik/searchengine-and-social-list",
|
||||||
|
"version": "1.3.5",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/piwik/searchengine-and-social-list.git",
|
||||||
|
"reference": "8302a7414bd48f44916bd4858859607838ac2526"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/piwik/searchengine-and-social-list/zipball/8302a7414bd48f44916bd4858859607838ac2526",
|
||||||
|
"reference": "8302a7414bd48f44916bd4858859607838ac2526",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Public Domain"
|
||||||
|
],
|
||||||
|
"description": "Search engine and social network definitions used by Piwik",
|
||||||
|
"time": "2016-11-09T20:36:59+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packages-dev": [],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": [],
|
||||||
|
"platform-dev": []
|
||||||
|
}
|
24
convert.sh
|
@ -1,20 +1,35 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
|
|
||||||
size=16
|
size=16
|
||||||
|
|
||||||
for i in src/**/*.{png,gif,jpg}; do
|
for i in src/**/*.{png,gif,jpg,ico}; do
|
||||||
echo "$i"
|
echo "$i"
|
||||||
absDirname=$(dirname "$i")
|
absDirname=$(dirname "$i")
|
||||||
origFilename=$(basename "$i")
|
origFilename=$(basename "$i")
|
||||||
browserCode=${origFilename%.*}
|
code=${origFilename%.*}
|
||||||
dirname="dist/${absDirname#src/}"
|
dirname="dist/${absDirname#src/}"
|
||||||
distFile="${dirname}/${browserCode}.png"
|
distFile="${dirname}/${code}.png"
|
||||||
echo "$distFile"
|
echo "$distFile"
|
||||||
if [ ! -d "$dirname" ]
|
if [ ! -d "$dirname" ]
|
||||||
then
|
then
|
||||||
mkdir -p "$dirname"
|
mkdir -p "$dirname"
|
||||||
fi
|
fi
|
||||||
|
if [[ $i == *.ico ]]
|
||||||
|
then
|
||||||
|
if file "$i" | grep -E "HTML|empty| data" # if no valid image
|
||||||
|
then
|
||||||
|
rm "$i"
|
||||||
|
else
|
||||||
|
if [ ! -d "tmp" ]
|
||||||
|
then
|
||||||
|
mkdir "tmp"
|
||||||
|
fi
|
||||||
|
largestIcon=$(python analyseIco.py "$i")
|
||||||
|
newIcon="tmp/${code}.ico"
|
||||||
|
convert ${i}\[$largestIcon\] $newIcon
|
||||||
|
i=$newIcon
|
||||||
|
fi
|
||||||
|
fi
|
||||||
convert \
|
convert \
|
||||||
"$i" \
|
"$i" \
|
||||||
-strip \
|
-strip \
|
||||||
|
@ -30,6 +45,7 @@ for i in src/**/*.{png,gif,jpg}; do
|
||||||
# make background transparent
|
# make background transparent
|
||||||
# keep transparency
|
# keep transparency
|
||||||
# cut border
|
# cut border
|
||||||
|
# get only one image from .ico
|
||||||
# resize while keeping the aspect ratio
|
# resize while keeping the aspect ratio
|
||||||
# center image
|
# center image
|
||||||
# fit to 16x16
|
# fit to 16x16
|
||||||
|
|
BIN
dist/Referrers/images/searchEngines/abcsok.no.png
vendored
Normal file
After Width: | Height: | Size: 856 B |
BIN
dist/Referrers/images/searchEngines/alexa.com.png
vendored
Normal file
After Width: | Height: | Size: 852 B |
BIN
dist/Referrers/images/searchEngines/alicesuche.aol.de.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
dist/Referrers/images/searchEngines/all.by.png
vendored
Normal file
After Width: | Height: | Size: 355 B |
BIN
dist/Referrers/images/searchEngines/altavista.de.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/altavista.fr.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/aolrecherche.aol.fr.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
dist/Referrers/images/searchEngines/aolsearch.aol.co.uk.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
dist/Referrers/images/searchEngines/aolsearch.aol.com.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
dist/Referrers/images/searchEngines/apollo7.de.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
dist/Referrers/images/searchEngines/ar.zapmeta.com.png
vendored
Normal file
After Width: | Height: | Size: 713 B |
BIN
dist/Referrers/images/searchEngines/ariadna.elmundo.es.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/arianna.libero.it.png
vendored
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
dist/Referrers/images/searchEngines/ask.com.png
vendored
Normal file
After Width: | Height: | Size: 355 B |
BIN
dist/Referrers/images/searchEngines/au.zapmeta.com.png
vendored
Normal file
After Width: | Height: | Size: 713 B |
BIN
dist/Referrers/images/searchEngines/avira-int.ask.com.png
vendored
Normal file
After Width: | Height: | Size: 863 B |
BIN
dist/Referrers/images/searchEngines/avira.search.ask.com.png
vendored
Normal file
After Width: | Height: | Size: 355 B |
BIN
dist/Referrers/images/searchEngines/be-fr.altavista.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/be-nl.altavista.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/bing.com.png
vendored
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
dist/Referrers/images/searchEngines/blekko.com.png
vendored
Normal file
After Width: | Height: | Size: 672 B |
BIN
dist/Referrers/images/searchEngines/blogs.icerocket.com.png
vendored
Normal file
After Width: | Height: | Size: 253 B |
BIN
dist/Referrers/images/searchEngines/busca.uol.com.br.png
vendored
Normal file
After Width: | Height: | Size: 701 B |
BIN
dist/Referrers/images/searchEngines/buscador.terra.cl.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dist/Referrers/images/searchEngines/buscador.terra.com.br.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dist/Referrers/images/searchEngines/buscador.terra.es.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dist/Referrers/images/searchEngines/ca.zapmeta.com.png
vendored
Normal file
After Width: | Height: | Size: 713 B |
BIN
dist/Referrers/images/searchEngines/cade.images.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/cade.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/cgi.search.biglobe.ne.jp.png
vendored
Normal file
After Width: | Height: | Size: 722 B |
BIN
dist/Referrers/images/searchEngines/classic.startpage.com.png
vendored
Normal file
After Width: | Height: | Size: 860 B |
BIN
dist/Referrers/images/searchEngines/de.toppreise.ch.png
vendored
Normal file
After Width: | Height: | Size: 253 B |
BIN
dist/Referrers/images/searchEngines/digg.com.png
vendored
Normal file
After Width: | Height: | Size: 458 B |
BIN
dist/Referrers/images/searchEngines/dir.gigablast.com.png
vendored
Normal file
After Width: | Height: | Size: 836 B |
BIN
dist/Referrers/images/searchEngines/dogpile.com.png
vendored
Normal file
After Width: | Height: | Size: 606 B |
BIN
dist/Referrers/images/searchEngines/duckduckgo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/ecosia.org.png
vendored
Normal file
After Width: | Height: | Size: 824 B |
BIN
dist/Referrers/images/searchEngines/en.toppreise.ch.png
vendored
Normal file
After Width: | Height: | Size: 253 B |
BIN
dist/Referrers/images/searchEngines/encrypted.google.com.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/espanol.images.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/espanol.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/eu.ixquick.com.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/fi.zapmeta.com.png
vendored
Normal file
After Width: | Height: | Size: 713 B |
BIN
dist/Referrers/images/searchEngines/forestle.org.png
vendored
Normal file
After Width: | Height: | Size: 824 B |
BIN
dist/Referrers/images/searchEngines/foretag.118700.se.png
vendored
Normal file
After Width: | Height: | Size: 280 B |
BIN
dist/Referrers/images/searchEngines/fr.toppreise.ch.png
vendored
Normal file
After Width: | Height: | Size: 253 B |
BIN
dist/Referrers/images/searchEngines/fr2.rpmfind.net.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dist/Referrers/images/searchEngines/go.mail.ru.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
dist/Referrers/images/searchEngines/google.com.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/image.search.yahoo.co.jp.png
vendored
Normal file
After Width: | Height: | Size: 683 B |
BIN
dist/Referrers/images/searchEngines/images.ask.com.png
vendored
Normal file
After Width: | Height: | Size: 355 B |
BIN
dist/Referrers/images/searchEngines/images.google.com.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/images.search.biglobe.ne.jp.png
vendored
Normal file
After Width: | Height: | Size: 722 B |
BIN
dist/Referrers/images/searchEngines/images.search.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/infospace.com.png
vendored
Normal file
After Width: | Height: | Size: 653 B |
BIN
dist/Referrers/images/searchEngines/int.search-results.com.png
vendored
Normal file
After Width: | Height: | Size: 355 B |
BIN
dist/Referrers/images/searchEngines/isearch.avg.com.png
vendored
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
dist/Referrers/images/searchEngines/ixquick.com.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/ixquick.de.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/k9safesearch.com.png
vendored
Normal file
After Width: | Height: | Size: 460 B |
BIN
dist/Referrers/images/searchEngines/listings.altavista.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/lite.qwant.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/m.baidu.com.png
vendored
Normal file
After Width: | Height: | Size: 247 B |
BIN
dist/Referrers/images/searchEngines/m.suche.web.de.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/malaysia.search.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/maps.google.com.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/meta.rrzn.uni-hannover.de.png
vendored
Normal file
After Width: | Height: | Size: 1,008 B |
BIN
dist/Referrers/images/searchEngines/meta.ua.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/metager.de.png
vendored
Normal file
After Width: | Height: | Size: 1,008 B |
BIN
dist/Referrers/images/searchEngines/metager2.de.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/news.baidu.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/nigma.ru.png
vendored
Normal file
After Width: | Height: | Size: 448 B |
BIN
dist/Referrers/images/searchEngines/no.zapmeta.com.png
vendored
Normal file
After Width: | Height: | Size: 713 B |
BIN
dist/Referrers/images/searchEngines/nortonsafe.search.ask.com.png
vendored
Normal file
After Width: | Height: | Size: 813 B |
BIN
dist/Referrers/images/searchEngines/nova.rambler.ru.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dist/Referrers/images/searchEngines/o2suche.aol.de.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
dist/Referrers/images/searchEngines/ocnsearch.goo.ne.jp.png
vendored
Normal file
After Width: | Height: | Size: 511 B |
BIN
dist/Referrers/images/searchEngines/one.cn.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/otsing.delfi.ee.png
vendored
Normal file
After Width: | Height: | Size: 284 B |
BIN
dist/Referrers/images/searchEngines/poisk.ru.png
vendored
Normal file
After Width: | Height: | Size: 400 B |
BIN
dist/Referrers/images/searchEngines/qc.images.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/qc.yahoo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/r.duckduckgo.com.png
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
dist/Referrers/images/searchEngines/recherche.aol.fr.png
vendored
Normal file
After Width: | Height: | Size: 282 B |
BIN
dist/Referrers/images/searchEngines/rechercher.aliceadsl.fr.png
vendored
Normal file
After Width: | Height: | Size: 943 B |
BIN
dist/Referrers/images/searchEngines/ricerca.virgilio.it.png
vendored
Normal file
After Width: | Height: | Size: 624 B |
BIN
dist/Referrers/images/searchEngines/rpmfind.net.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dist/Referrers/images/searchEngines/s1-eu.ixquick.de.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/s2-eu4.ixquick.com.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/s5-eu4.ixquick.com.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/s8-eu.ixquick.com.png
vendored
Normal file
After Width: | Height: | Size: 720 B |
BIN
dist/Referrers/images/searchEngines/scholar.google.com.png
vendored
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
dist/Referrers/images/searchEngines/scour.com.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
dist/Referrers/images/searchEngines/search-dyn.tiscali.it.png
vendored
Normal file
After Width: | Height: | Size: 243 B |
BIN
dist/Referrers/images/searchEngines/search-intl.netscape.com.png
vendored
Normal file
After Width: | Height: | Size: 282 B |