commit 3d34c2f90b25c58599af3f2dedb3b025cbe3c78a Author: The Dod Date: Mon Aug 3 23:18:28 2020 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a62f732 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv/ +index.html diff --git a/.~lock.feeds.csv# b/.~lock.feeds.csv# new file mode 100644 index 0000000..cfab920 --- /dev/null +++ b/.~lock.feeds.csv# @@ -0,0 +1 @@ +,joe,pravda,03.08.2020 21:52,file:///home/joe/.config/libreoffice/4; \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..de6985a --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +If you have linux: + +Run `./install.sh` once, and then you can + +* `soffice feeds.csv` +* Save +* Run `./makehtml.sh` +* Enjoy your new `index.html` + diff --git a/doit.sh b/doit.sh new file mode 100755 index 0000000..6aeba9e --- /dev/null +++ b/doit.sh @@ -0,0 +1,4 @@ +#!/bin/sh +cd "$(dirname "$0")" +. venv/bin/activate +python makehtml.py diff --git a/feeds.csv b/feeds.csv new file mode 100644 index 0000000..9d86e06 --- /dev/null +++ b/feeds.csv @@ -0,0 +1,8 @@ +https://www.facebook.com/orly.barlev1/videos/vb.100000481996007/4776206295738723/,אורלי בר +https://www.facebook.com/IsraelCrimeMinister/videos/2991255197669387/,משה זוכמיר +https://www.facebook.com/democratv/videos/4272752819563187/,מיקי חי +https://www.facebook.com/orly.barlev1/videos/vb.100000481996007/4776206295738723/,אורלי בר +https://www.facebook.com/IsraelCrimeMinister/videos/2991255197669387/,משה זוכמיר +https://www.facebook.com/democratv/videos/4272752819563187/,מיקי חי +https://www.facebook.com/orly.barlev1/videos/vb.100000481996007/4776206295738723/,אורלי בר +https://www.facebook.com/IsraelCrimeMinister/videos/2991255197669387/,משה זוכמיר diff --git a/index.mustache b/index.mustache new file mode 100644 index 0000000..06527e0 --- /dev/null +++ b/index.mustache @@ -0,0 +1,81 @@ + + + + + + BBCrime director's grid + + + +
+ + + + + + + + + + + + + + + + + + + +
+

+ {{{text1}}} +
+

+ {{{text2}}} +
+

+ {{{text3}}} +
+

+ {{{text4}}} +
+ כאן יהיה מיתוג וכאלה +
+ +
+
+

+ {{{text5}}} +
+

+ {{{text6}}} +
+

+ {{{text7}}} +
+

+ {{{text8}}} +
+ + diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..ea31f45 --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +echo Creating virtualenv... +virtualenv -p python3 venv +. venv/bin/activate +echo Installing dependencies... +pip install -r requirements.txt +echo Done. +echo Edit feeds.csv, then run ./doit.sh to generate index.html diff --git a/makehtml.py b/makehtml.py new file mode 100644 index 0000000..b0a41c0 --- /dev/null +++ b/makehtml.py @@ -0,0 +1,18 @@ +import csv +import pystache + +sheet = csv.reader(open('feeds.csv', encoding='utf-8')) +feeds = {} +index = 0 +for url, text in sheet: + index += 1 + print('{}: "{}", "{}"'.format(index, url, text)) + feeds['url{}'.format(index)] = url + feeds['text{}'.format(index)] = text + +open('index.html', 'w', encoding='utf-8').write( + pystache.render( + open('index.mustache', encoding='utf-8').read(), + feeds)) + +print('Wrote {} items'.format(index)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e6c4f3c --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pystache==0.5.4