Das gesamte shiaiVerzeichnis war nicht getrackt
This commit is contained in:
163
shiai/wkOrg/ausschreibungen/checkDownloads.sh
Executable file
163
shiai/wkOrg/ausschreibungen/checkDownloads.sh
Executable file
@@ -0,0 +1,163 @@
|
||||
# Script zu checken, ob Ausschreibungen neu dazugekommen sind oder sich geändert haben
|
||||
|
||||
# Aufbau der Wettkampfdatenbank:
|
||||
# Tabellen
|
||||
# - downloads -> Verwalten der heruntergeladenen Ausschreibungen
|
||||
# - adressen -> Verwalten von Adressen der Wettkampforte
|
||||
# - wk -> Verwalten der Wettkämpfe
|
||||
# Aufbau der einzelnen Tabellen:
|
||||
# - downloads
|
||||
# - id PRIMARY KEY INT -> Die interne ID der Ausschreibung
|
||||
# - dateiname TEXT -> der Dateiname der Auschreibung
|
||||
# - sha512 TEXT -> Hash der Datei
|
||||
# - wkID TEXT -> IDs der zugehörigen Wettkämpfe (kommasepariert, leer soll heißen uninteresannte Ausschreibung)
|
||||
# - wk
|
||||
# - id PRIMARY KEY INT -> Die interne ID des Wettkampfes
|
||||
# - datum TEXT -> Datum des Wettkampfes
|
||||
# - name TEXT -> Name des Wettkampfes
|
||||
# - adrID -> ID des Wettkampfortes in der Adressdatenbank
|
||||
|
||||
|
||||
|
||||
# Über Dateinamenliste iterieren
|
||||
filelist=`ls -1A download/`
|
||||
for file in $filelist
|
||||
do
|
||||
# Hash der Datei merken
|
||||
hash=`rhash --printf=%{sha512} download/"$file"`
|
||||
# sqlQuery zusammenstellen: Alle AusschreibungsIDs suchen, die diese Ausschreibung haben
|
||||
query="SELECT id FROM downloads WHERE dateiName='$file';"
|
||||
ids=`echo $query | sqlite wk.db`
|
||||
echo "Gefundene wkIDs: $ids"
|
||||
if
|
||||
[[ $ids = "" ]]
|
||||
then
|
||||
# Wenn dateiname noch nicht in der Datenbank gefunden wurde, Eintrag neu anlegen
|
||||
# echo "$file noch nicht zugeordnet!"
|
||||
# Wettkampfdaten abfragen
|
||||
# echo `evince download/$file &`
|
||||
mupdf download/$file &
|
||||
echo "Ausschreibung: $file"
|
||||
echo "Datum (bei mehreren Daten per Leertaste getrennt, zum Ignorieren nichts):"
|
||||
read daten
|
||||
# Werden keine Daten eingegeben, dann soll die Ausschreibung ignoriert werden
|
||||
if test -z $daten
|
||||
then
|
||||
query="INSERT INTO downloads(dateiname, sha512, wkID) VALUES('$file', '$hash', -1);"
|
||||
echo $query | sqlite wk.db
|
||||
continue
|
||||
else
|
||||
# Ansonsten wird für jedes Datum ein Wettkampf angelegt
|
||||
wkName = ""
|
||||
plz = ""
|
||||
ak = ""
|
||||
for datum in $daten
|
||||
do
|
||||
echo "$datum:"
|
||||
# Ausgabe anderer WK an diesem Datum
|
||||
query="SELECT id,name FROM wk WHERE datum='$datum';"
|
||||
wks=`echo $query | sqlite wk.db`
|
||||
echo $wks
|
||||
# Eingabe des Wettkampfnamens (bei mehreren Daten kann mit leerem Namen einfach der zuletzt eingegebene Name verwendet werden)
|
||||
echo "Wettkampfname: ($wkName)"
|
||||
read temp
|
||||
if test -z $temp
|
||||
then
|
||||
echo "Wettkampfname übernommen: $wkName"
|
||||
else
|
||||
wkName = temp
|
||||
fi
|
||||
# Eingabe der Postleitzahl des Wettkampfortes
|
||||
echo "PLZ: ($plz)"
|
||||
read temp
|
||||
if test -z $temp
|
||||
then
|
||||
echo "PLZ übernommen: $plz"
|
||||
else
|
||||
plz = temp
|
||||
fi
|
||||
# Zur Postleitzahl gehörige Adresse finden
|
||||
query="SELECT id FROM adressen WHERE plz='$plz';"
|
||||
adrIDs=`echo $query | sqlite wk.db`
|
||||
if test -z $adrIDs
|
||||
then
|
||||
# @todo: Eingabe der Adresse
|
||||
echo "Keine zugehörige Adresse gefunden!"
|
||||
adrID = 0
|
||||
#else
|
||||
# @todo: Behandlung verschiedener Adressen mit gleicher PLZ ergänzen
|
||||
fi
|
||||
# Eingabe der Altersklassen
|
||||
echo "AK: ($ak)"
|
||||
read temp
|
||||
if test -z $temp
|
||||
then
|
||||
echo "Übernommene AK: $ak"
|
||||
else
|
||||
ak = temp
|
||||
fi
|
||||
# Hinzufügen des Wettkampfes zur Datenbank
|
||||
query="INSERT INTO wk(datum, name, ak, adrID) VALUES('$datum','$wkName','$ak','adrID');"
|
||||
`echo $query | sqlite wk.db`
|
||||
# Eintrag in die Ausschreibungsdatenbank; Dazu brauchen wir die wkID
|
||||
query="SELECT id FROM wk WHERE datum='$datum' AND name='$wkName' AND ak='$ak';"
|
||||
wkID=`echo $query | sqlite wk.db`
|
||||
query="INSERT INTO downloads(dateiname, sha512, wk) VALUES('$file', '$hash', '$wkID');"
|
||||
echo $query | sqlite wk.db
|
||||
done # nächstes Datum
|
||||
fi # Ende Hinzufügen eines neuen Wettkampfes
|
||||
# Wenn wir wkIDs für diese Ausschreibung gefunden haben müssen wir testen, ob sich der Hash geändert hat
|
||||
else
|
||||
query="SELECT sha512 FROM downloads WHERE dateiName='$file';"
|
||||
dbhash=`echo $query | sqlite wk.db`
|
||||
if
|
||||
[[ $hash != $dbhash ]]
|
||||
then
|
||||
echo "$file hat sich geändert!"
|
||||
query="SELECT wkID FROM downloads WHERE dateiName='$file';"
|
||||
wkIDs=`echo $query | sqlite wk.db`
|
||||
echo "Betroffene Wettkämpfe: $wkIDs"
|
||||
# todo Bei einer geänderten Ausschreibung die daten des Wettkampfeintrages anpassen
|
||||
for wkID in $wkIDs
|
||||
do
|
||||
query="SELECT name FROM wk WHERE id='$wkID';"
|
||||
wkName=`echo $query | sqlite wk.db`
|
||||
echo "Wettkampfname: ($wkName)"
|
||||
read temp
|
||||
if test -z $temp
|
||||
then
|
||||
echo "Wettkampfname übernommen: $wkName"
|
||||
else
|
||||
wkName = temp
|
||||
fi
|
||||
query="SELECT datum FROM wk WHERE id='$wkID';"
|
||||
wkDatum=`echo $query | sqlite wk.db`
|
||||
echo "Datum: ($wkDatum)"
|
||||
read temp
|
||||
if test -z $temp
|
||||
then
|
||||
echo "Datum übernommen: $Datum"
|
||||
else
|
||||
wkDatum = temp
|
||||
fi
|
||||
query="SELECT ak FROM wk WHERE id='$wkID';"
|
||||
wkAk=`echo $query | sqlite wk.db`
|
||||
echo "Ak: ($wkAk)"
|
||||
read temp
|
||||
if test -z $temp
|
||||
then
|
||||
echo "Ak übernommen: $wkAk"
|
||||
else
|
||||
wkAk= temp
|
||||
fi
|
||||
query="UPDATE wk SET name='$wkName',datum='$wkDatum',ak='$wkAk' WHERE id=$id;"
|
||||
`echo $query | sqlite wk.db`
|
||||
done
|
||||
query="UPDATE downloads SET sha512='$hash' WHERE id=$id;"
|
||||
`echo $query | sqlite wk.db`
|
||||
# @todo: Update der Ausschreibung zum Upload auslösen
|
||||
else
|
||||
echo "$file unverändert!"
|
||||
fi # ende unveränderte ausschreibung
|
||||
fi # ende existenz ausschreibung
|
||||
done # ende dateilistenschleife
|
||||
23
shiai/wkOrg/ausschreibungen/download.sh
Executable file
23
shiai/wkOrg/ausschreibungen/download.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
# Skript zu Downloaden von Ausschreibungen
|
||||
|
||||
#---
|
||||
# Ausschreibungen von der Kalenderseite von Sachsenjudo
|
||||
#---
|
||||
|
||||
# Sachsenjudos Eventseite mit den Wettkämpfen laden und Events parsen (und merken)
|
||||
curl http://judoverbandsachsen.de/kalender/?term_id%5B%5D=48 | grep --only-matching "http://judoverbandsachsen.de/events/[^\"]*" > events.list
|
||||
|
||||
|
||||
# Die Links zu den Eventseiten Parsen und speichern
|
||||
|
||||
# evtl. vorhandene, alte Liste löschen
|
||||
rm -f eventDoc.list
|
||||
# Jede event-URL durchgehen, und die URL der Ausschreibung parsen (und merken)
|
||||
for url in $(cat events.list); do
|
||||
curl $url | grep --only-matching "http://judoverbandsachsen.de/wp-content/files_mf/[^\"]*\.\(pdf\|djvu\|doc\|docx\)" >> eventDoc.list
|
||||
done
|
||||
# Die gesammelten Ausschreibungs-URLs downloaden (nur die neueren)
|
||||
wget --timestamping --random-wait -P download --input-file=eventDoc.list
|
||||
|
||||
# Aufräumen
|
||||
rm -f events.list eventDoc.list
|
||||
BIN
shiai/wkOrg/ausschreibungen/download/1413623640BEM_U11_MF.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413623640BEM_U11_MF.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1413624524Holzmichel.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413624524Holzmichel.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1413624846RKP_2014.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413624846RKP_2014.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1413625067NikolausFB14.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413625067NikolausFB14.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1413625490BEM_U13.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413625490BEM_U13.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1413625546ergebnisse.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413625546ergebnisse.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1413625558AlleListen.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1413625558AlleListen.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/141561580530.Mixpokal.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/141561580530.Mixpokal.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1415615948Auerturnier.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1415615948Auerturnier.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1415616101Kinder.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1415616101Kinder.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1415616542bscnik2015.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1415616542bscnik2015.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1417091469BEM_U13_U18.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1417091469BEM_U13_U18.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1421662016ergebnisse.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1421662016ergebnisse.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1421662032AlleListen.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1421662032AlleListen.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1421786030RKP_2015.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1421786030RKP_2015.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1423323986ErgebnisseU18.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1423323986ErgebnisseU18.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1423729013MDEMU18.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1423729013MDEMU18.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1423729086MDEMU21.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1423729086MDEMU21.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/14240358562015BEM_U15.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/14240358562015BEM_U15.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/14241939302015_BEM_U15.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/14241939302015_BEM_U15.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1424207263MDEMU18.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1424207263MDEMU18.pdf
Normal file
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1424207326MDEMU21.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1424207326MDEMU21.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/14246335032015_Lipsiade.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/14246335032015_Lipsiade.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1427401533dr.Holzmichel.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1427401533dr.Holzmichel.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1430244703KFA7.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1430244703KFA7.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/download/1431953926Ergebnisse.pdf
Normal file
BIN
shiai/wkOrg/ausschreibungen/download/1431953926Ergebnisse.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
shiai/wkOrg/ausschreibungen/wk.db
Normal file
BIN
shiai/wkOrg/ausschreibungen/wk.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user