Initial commit

This commit is contained in:
The Dod 2020-08-03 23:18:28 +03:00
commit 3d34c2f90b
9 changed files with 131 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
venv/
index.html

1
.~lock.feeds.csv# Normal file
View File

@ -0,0 +1 @@
,joe,pravda,03.08.2020 21:52,file:///home/joe/.config/libreoffice/4;

9
README.md Normal file
View File

@ -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`

4
doit.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cd "$(dirname "$0")"
. venv/bin/activate
python makehtml.py

8
feeds.csv Normal file
View File

@ -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/,משה זוכמיר
1 https://www.facebook.com/orly.barlev1/videos/vb.100000481996007/4776206295738723/ אורלי בר
2 https://www.facebook.com/IsraelCrimeMinister/videos/2991255197669387/ משה זוכמיר
3 https://www.facebook.com/democratv/videos/4272752819563187/ מיקי חי
4 https://www.facebook.com/orly.barlev1/videos/vb.100000481996007/4776206295738723/ אורלי בר
5 https://www.facebook.com/IsraelCrimeMinister/videos/2991255197669387/ משה זוכמיר
6 https://www.facebook.com/democratv/videos/4272752819563187/ מיקי חי
7 https://www.facebook.com/orly.barlev1/videos/vb.100000481996007/4776206295738723/ אורלי בר
8 https://www.facebook.com/IsraelCrimeMinister/videos/2991255197669387/ משה זוכמיר

81
index.mustache Normal file
View File

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.7.28">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>BBCrime director's grid</title>
</head>
<body>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script async defer src=
"https://connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v3.2"></script>
<table style="direction:rtl">
<tbody>
<tr>
<td>
<div id="vid1" class="fb-video" data-href="{{{url1}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text1}}}
</td>
<td>
<div id="vid2" class="fb-video" data-href="{{{url2}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text2}}}
</td>
<td>
<div id="vid2" class="fb-video" data-href="{{{url3}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text3}}}
</td>
</tr>
<tr>
<td>
<div id="vid1" class="fb-video" data-href="{{{url4}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text4}}}
</td>
<td style="text-align: center; vertical-align: bottom">
כאן יהיה מיתוג וכאלה
<form>
<textarea name="announcement" style=
"overflow: hidden; font-size:150%; text-align:center; width: 100%; border:none; height:6em"></textarea>
</form>
</td>
<td>
<div id="vid2" class="fb-video" data-href="{{{url5}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text5}}}
</td>
</tr>
<tr>
<td>
<div id="vid1" class="fb-video" data-href="{{{url6}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text6}}}
</td>
<td>
<div id="vid2" class="fb-video" data-href="{{{url7}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text7}}}
</td>
<td>
<div id="vid2" class="fb-video" data-href="{{{url8}}}"
data-width="360" data-show-text="false" data-autoplay=
"true"></div><br>
{{{text8}}}
</td>
</tr>
</tbody>
</table>
</body>
</html>

7
install.sh Executable file
View File

@ -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

18
makehtml.py Normal file
View File

@ -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))

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
pystache==0.5.4