User:Tancre/Others/How to set a live collective webpage (Raspberry Pi+Etherpad): Difference between revisions

From XPUB & Lens-Based wiki
Line 1: Line 1:
= How to set a 'live' collective webpage =
= How to set a 'live' collective webpage =
A live collective page allows to write collectively a pad that automatically generate an html page.
A live collective page allows to write collectively a pad that automatically generate an html page.
 
== Infos ==
=== What do you need? ===
=== What do you need? ===
* web server (Rapberry pi + apache2)
* web server (Rapberry pi + apache2)
Line 12: Line 12:
The html file can be accessed online through the server.
The html file can be accessed online through the server.


== Where and What ==
== Code ==
/var/www/html/liveHTML
/var/www/html/liveHTML
*README.txt
*README.txt
*live.sh (generate live.html)
*live.sh (it generates *live.html)


=== live.sh ===
=== live.sh ===

Revision as of 19:27, 23 January 2019

How to set a 'live' collective webpage

A live collective page allows to write collectively a pad that automatically generate an html page.

Infos

What do you need?

  • web server (Rapberry pi + apache2)
  • etherpad
  • Wget

How does it work?

Looping wget is possible to download every x sexonds the text from a pad into an html file.
Adding the meta refresh method into the head of the html (in the pad), the page reload automatically.
The html file can be accessed online through the server.

Code

/var/www/html/liveHTML

  • README.txt
  • live.sh (it generates *live.html)

live.sh

#!/bin/bash

while true                                                       # run a loop
do
wget -O live.tmp https://pad.xpub.nl/p/test/export/txt           # download the txt of a pad's link into a file.tmp
mv live.tmp live.html                                            # rename .tmp into .html
sleep 5                                                          # 5 seconds delay
done                                                             # restart the loop