From ad97745580562d2c090d1b0659f504481dfd85b6 Mon Sep 17 00:00:00 2001 From: Marcin Wozniak Date: Sat, 13 Apr 2019 22:37:33 +0200 Subject: [PATCH] Version 1.0 --- README.md | 28 +++++++++++++++++++++++++ rozklad | 11 ++++++++++ schedule | 11 ++++++++++ start.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100755 rozklad create mode 100755 schedule create mode 100755 start.sh diff --git a/README.md b/README.md index e69de29..5361f5e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,28 @@ +# What did I use? +Firstly, I must thank https://github.com/xavery/ +I use so much your work. Thank You + +# Instalation +```sh +git clone https://github.com/linux923344/rozklad-mpk.git +``` +In the `start.sh` you must change varable `HTML` , because your schadule will be on the `your-page.pl/rozklad`. +For example if you change it for `test123` You will have `your-page.pl/test123` + +The script will NOT create a new directory ;) + +Also you can change the varable `lines`. I added my favourites line like `KORN42 MURA42 OPL01 ORZE42 RKAP73 SOB42 UAMB01`. + +# Starting script +If you want to start the script you can run +```sh +./start.sh +``` + +# Simple +My schadule is in the http://yorune.pl/rozklad/ + +# Contact with me +You can write e-mail to me y0rune@aol.com + + diff --git a/rozklad b/rozklad new file mode 100755 index 0000000..4049c40 --- /dev/null +++ b/rozklad @@ -0,0 +1,11 @@ +#!/bin/bash +peka_vm_get() +{ + curl -H 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8' \ + http://www.peka.poznan.pl/vm/method.vm \ + -d "method=$1" \ + -d "p0=$2" \ + -s +} + +peka_vm_get getTimes '{"symbol":"'$1'"}' | jq -r '.[] | [.times] | .[] | .[] | [.minutes,.line,.direction] | @csv' | awk -v FS="," 'BEGIN{print "Min\tLine\tDirection\t";print "==================================="}{printf "%s\t%s\t%s%s",$1,$2,$3,ORS}' diff --git a/schedule b/schedule new file mode 100755 index 0000000..4049c40 --- /dev/null +++ b/schedule @@ -0,0 +1,11 @@ +#!/bin/bash +peka_vm_get() +{ + curl -H 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8' \ + http://www.peka.poznan.pl/vm/method.vm \ + -d "method=$1" \ + -d "p0=$2" \ + -s +} + +peka_vm_get getTimes '{"symbol":"'$1'"}' | jq -r '.[] | [.times] | .[] | .[] | [.minutes,.line,.direction] | @csv' | awk -v FS="," 'BEGIN{print "Min\tLine\tDirection\t";print "==================================="}{printf "%s\t%s\t%s%s",$1,$2,$3,ORS}' diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..21a0201 --- /dev/null +++ b/start.sh @@ -0,0 +1,63 @@ +#!/bin/bash +#-----CHANGE IT------ + +HTML="../rozklad" +lines=(KORN42 MURA42 OPL01 ORZE42 RKAP73 SOB42 UAMB01) + +#------------------- + +mkdir -p ./lines +LINE=$1 +output=$(echo "\$output") +for line in "${lines[@]}"; do +cat << EOF > lines/$line.php +$output"; +?> +EOF +done + +#CREATE INDEX +cat << EOF > index.php + + +POZNAŃ Rozkład Jazdy + + + + + + +EOF + + +