Makefile and documentation

This commit is contained in:
Marian Steinbach 2018-04-05 19:39:09 +02:00
parent daa002b506
commit f24276d891
5 changed files with 37307 additions and 10 deletions

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
.PHONY: webapp
# Python venv for running the spider locally
venv:
virtualenv -p python3 venv
venv/bin/pip3 install -r requirements.txt
spider: venv
venv/bin/python ./spider.py
webapp/node_modules:
cd webapp && npm install
# Build webapp
webapp: webapp/node_modules
cd webapp && npx webpack --config webpack.config.js
rm -rf ./docs
cp -r webapp/dist ./docs

View File

@ -4,6 +4,22 @@ Collects data on green websites and checks for things like SEO, performance, TLS
Written and tested in Python3
### Usage
Run the spider:
```nohighlight
make spider
```
The result will be in `webapp/dist/data`.
Build the webapp:
```nohighlight
make webapp
```
### Ideas
- If the URL does not start with `www.`, will entering `www.<url>` also work?
@ -15,13 +31,3 @@ Written and tested in Python3
- Detect which one of the well-known CMS is used
- Certificate expiry warning
- Favourite icon availability check
### Usage
```nohighlight
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
python spider.py
```

85
docs/bundle.js Normal file

File diff suppressed because one or more lines are too long

37126
docs/data/spider_result.json Normal file

File diff suppressed because it is too large Load Diff

60
docs/index.html Normal file
View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>green spider report: Auswertung einiger Merkmale von Bündnis 90/Die Grünen Websites</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css">
<style type="text/css">
body {
padding: 20px;
}
.bad {
background-color: #ffdbdb;
}
.good {
background-color: #cfeaa8;
}
</style>
</head>
<body>
<div class="container-fluid">
<p>Erläuterungen der Testkriterien am <a href="#docs">Ende der Seite</a>. Gehe zum <a href="https://github.com/netzbegruenung/green-spider/">green-spider GitHub repository</a> um mehr zu erfahren.</p>
<table class="table">
<thead>
<tr>
<th scope="col">URL</th>
<th scope="col"><abbr title="Site ist sowohl mit www. als auch ohne www. in URL erreichbar">www. optional</abbr></th>
<th scope="col"><abbr title="URL-Varianten leiten auf eine einzige Startseiten-URL weiter">Kanonische URL</abbr></th>
<th scope="col"><abbr title="Site nutzt HTTP-Verschlüsselung">HTTPS</abbr></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<hr>
<h3 id="docs">Testkriterien</h3>
<h4>www. optional</h4>
<p>Die Site sollte sowohl mit &quot;www.&quot; als auch ohne &quot;www.&quot; am Anfang der URL erreichbar sein.</p>
<h4>Kanonische URL</h4>
<p>Verschiedene URLs zum Aufruf der Site (mit/ohne &quot;www.&quot; Präfix, mit/ohne HTTPS) sollten alle per HTTP Redirect auf eine einzige &quot;kanonische&quot; URL weiter leiten.</p>
<h4>HTTPS</h4>
<p>Die Site ist per verschlüsselter HTTP-Verbindung (HTTPS-Protokoll) erreichbar.</p>
</div>
<script src="bundle.js"></script>
</body>
</html>