summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorjesusalva <cpntb1@ymail.com>2018-02-16 00:49:26 -0200
committerjesusalva <cpntb1@ymail.com>2018-02-16 00:49:26 -0200
commit3df45019fa108a1384be93a543399f95f68f35a6 (patch)
tree7e1f17262ff45118d4ffc9a16e120cb0763fc7e0 /web
parent5f364c98a084ef3915c0fceba237274f1a1aa3bd (diff)
downloadtools-3df45019fa108a1384be93a543399f95f68f35a6.tar.gz
tools-3df45019fa108a1384be93a543399f95f68f35a6.tar.bz2
tools-3df45019fa108a1384be93a543399f95f68f35a6.tar.xz
tools-3df45019fa108a1384be93a543399f95f68f35a6.zip
Update news generator
Diffstat (limited to 'web')
-rw-r--r--web/backup.bin68
-rw-r--r--web/index.bin2
-rw-r--r--web/news.html6
-rwxr-xr-xweb/news_to_html.py27
4 files changed, 31 insertions, 72 deletions
diff --git a/web/backup.bin b/web/backup.bin
deleted file mode 100644
index 5a4da16..0000000
--- a/web/backup.bin
+++ /dev/null
@@ -1,68 +0,0 @@
-
-<h3><a name=2018-02-16>2018-02-14</a></h3>
-
-<font color=black></font><font color=black> Actual Release: <font color=red>Pilot-I Testing
-<br/>
-</font><font color=black> Welcome to <b>The Mana World 2</b>!
-<br/>
-</font><font color=black> By playing you agree and abide to the <font color=red>Terms of Service</font><font color=black> of <b>The Mana World 2</b>, available at:
-<br/>
-<font color=red> <a href="https://gitlab.com/TMW2/TheManaWorld_Wiki/wikis/Rules">https://gitlab.com/TMW2/TheManaWorld_Wiki/wikis/Rules</a>
-<br/>
-
-<br/>
-<font color=red> Our Staff will never ask for your password. You are the sole responsible for
-<br/>
-<font color=red> its safety!
-<br/>
-<font color=green> If you ever run in trouble, try contacting a GM with <b>@request Help me!</b>
-<br/>
-<font color=green> Please enjoy our server, and have fun!
-<br/>
-
-<br/>
-<font color=purple> <b>The adventure begins!</b>
-<br/>
-
-<br/>
-<font color=purple> Release 1: Candy!
-<br/>
-
-<br/>
-</font><font color=black> The work which started at mid-january is currently advancing.
-<br/>
-</font><font color=black> You can travel with Nard to Candor and later, you'll be able to visit Tulishmar.
-<br/>
-</font><font color=black> Remember that this is not TMW:rEvolt, even if many aspects are similar.
-<br/>
-
-<br/>
-</font><font color=black> Due the very early stages of development, we may need to do a full account reset
-<br/>
-</font><font color=black> before next release, so do not get too attached to it :>
-<br/>
-</font><font color=black> The early stage also means constant server resets and updates. Sorry.
-<br/>
-
-<br/>
-</font><font color=black> This is a Pilot Release, and therefore, not much content is present.
-<br/>
-</font><font color=black> We welcome all contributors who are willing to join.
-<br/>
-
-<br/>
-</font><font color=black> Have fun, the adventure starts now!
-<br/>
-
-<br/>
-<font color=brown> -- Your TMW2 Team
-<br/>
-<font color=brown> February 2018
-<br/>
-
-<br/>
-</font><font color=black> You can check out this page for older entries:
-<br/>
-<font color=red> <a href="http://tmw2.org/news.html">http://tmw2.org/news</a>
-<br/>
-</font><hr/>
diff --git a/web/index.bin b/web/index.bin
new file mode 100644
index 0000000..a22eb99
--- /dev/null
+++ b/web/index.bin
@@ -0,0 +1,2 @@
+2018-02-16
+2018-02-14
diff --git a/web/news.html b/web/news.html
index 6ecfe08..c7c714f 100644
--- a/web/news.html
+++ b/web/news.html
@@ -1,4 +1,6 @@
-<!DOCTYPE HTML><html><head><title>Server News</title></head><body>
+<!DOCTYPE HTML><html><head><title>Server News</title></head><body><table border=1 align=left><tr><td>Archive</td></tr><tr><td><a href=2018-02-16>2018-02-16</a></td></tr><tr><td><a href=2018-02-14>2018-02-14</a></td></tr></table><br/>
+
+<font color=black></font><hr/>
<h3><a name=2018-02-16>2018-02-16</a></h3>
<font color=black></font><font color=black> Actual Release: <font color=red>Pilot-II Testing
@@ -167,4 +169,4 @@
<font color=red> <a href="http://tmw2.org/news.html">http://tmw2.org/news</a>
<br/>
</font><hr/>
-</body></html> \ No newline at end of file
+</body></html>
diff --git a/web/news_to_html.py b/web/news_to_html.py
index 0f0b7c1..22ddb4c 100755
--- a/web/news_to_html.py
+++ b/web/news_to_html.py
@@ -7,6 +7,21 @@
import datetime
date=str(datetime.date.today())
+# Update the INDEX
+i1=open("index.bin", "r")
+i2=open("1index.bin", "w")
+for i in i1:
+ i2.write(i)
+i2.close()
+i1.close()
+i1=open("index.bin", "w")
+i2=open("1index.bin", "r")
+i1.write(date+'\n')
+for i in i2:
+ i1.write(i)
+i2.close()
+i1.close()
+i1=open("index.bin", "r")
# Prepare to sort from newest to oldest
dt=open("all_news.bin", "r")
@@ -22,7 +37,7 @@ dc=open("backup.bin", "r")
ns=open("../update/news.txt", "r")
dt.write("\n<h3><a name="+date+">"+date+"</a></h3>\n\n<font color=black>")
-# Function to markup it
+# Function to markup it, and strip new lines
def markup(r):
r=r.replace('##0', '</font><font color=black>')
r=r.replace('##1', '<font color=red>')
@@ -40,6 +55,8 @@ def markup(r):
r=r.replace('|', '">')
r=r.replace('@@]', '</a>')
return r
+def nn(r):
+ return r.replace('\n', '')
# Write the news at all_news.bin, and then reload the backup. Finally, close the file
for i in ns:
@@ -57,10 +74,16 @@ wp=open("news.html", "w")
dt=open("all_news.bin", "r")
wp.write("<!DOCTYPE HTML><html><head><title>Server News</title></head><body>")
+wp.write("<table border=1 align=left><tr><td>Archive</td></tr>")
+for i in i1:
+ wp.write('<tr><td><a href='+nn(i)+'>'+nn(i)+'</a></td></tr>')
+wp.write('</table><br/>')
+
for line in dt:
- wp.write(line)
+ wp.write(nn(line))
wp.write("</body></html>")
wp.close()
dt.close()
+i1.close()