summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorjesusalva <cpntb1@ymail.com>2018-03-05 23:08:30 -0300
committerjesusalva <cpntb1@ymail.com>2018-03-05 23:08:30 -0300
commit8eaa88d4cef5e732e37fd760eea1157de244cb4b (patch)
treed084a1e24d85ea83f10f679170aa1f53889f1314 /web
parent96893688121092c3f362edbed6a319098b47f8af (diff)
downloadtools-8eaa88d4cef5e732e37fd760eea1157de244cb4b.tar.gz
tools-8eaa88d4cef5e732e37fd760eea1157de244cb4b.tar.bz2
tools-8eaa88d4cef5e732e37fd760eea1157de244cb4b.tar.xz
tools-8eaa88d4cef5e732e37fd760eea1157de244cb4b.zip
Unify updates. Include a fancy RSS Atom Feed for... reasons.
Diffstat (limited to 'web')
-rw-r--r--web/feed.xml104
-rwxr-xr-xweb/newsfeed.py98
-rw-r--r--web/nf_main.xml91
3 files changed, 293 insertions, 0 deletions
diff --git a/web/feed.xml b/web/feed.xml
new file mode 100644
index 0000000..e9ce721
--- /dev/null
+++ b/web/feed.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>TMW2</title>
+ <link href="https://tmw2.org/feed.xml" rel="self"/>
+ <link href="https://tmw2.org"/>
+ <updated>2018-03-06T01:56:59.145089</updated>
+ <id>https://tmw2.org</id>
+ <author>
+ <name>TMW2 Project</name>
+ <email>admin@tmw2.org</email>
+ </author>
+ <entry>
+ <title> 01.5 - Can I Break This Pipeline?</title>
+ <link href="https://tmw2.org/news#2018-03-02"/>
+ <updated>2018-03-06T01:56:59.145089</updated>
+ <id>tag:tmw2.org,2018-03-02</id>
+ <content type="html"><![CDATA[<p> Welcome to <b>TMW-2: Monster Wars</b>!
+</p>
+<p> By playing you agree and abide to the <b>Terms of Service</b>, available at:
+</p>
+<p> <a href="https://tmw2.org/legal.php">https://tmw2.org/legal.php</a>
+</p>
+<p> Last ToS update: 2018-02-24
+</p>
+<p>
+</p>
+<p> Our Staff will never ask for your password. You are the sole responsible for
+</p>
+<p> its safety!
+</p>
+<p> If you ever run in trouble, try contacting a GM with <b>@request Help me!</b>
+</p>
+<p> Please enjoy our server, and have fun!
+</p>
+<p>
+</p>
+<p> Latest release: <b>2018-03-04</b> (Easter stuff, bug fixes)
+</p>
+<p> Never miss a release! Follow our <a href="https://discord.gg/BQNTe68">Discord Channel</a>!
+</p>
+<p>
+</p>
+<p> Your head aches. Your vision is dizzy. A ship appears in your front. Oh no,
+</p>
+<p> please don't tell me this is Evol!
+</p>
+<p>
+</p>
+<p> You may meet familiar faces and/or names, and even places you think that you
+</p>
+<p> know, but don't be fooled - things are different here, and work different here.
+</p>
+<p> Awake in Nard ship, visit Candor, journey to Tulimshar - the game offers the
+</p>
+<p> basic stuff a MMORPG needs. Use Tulimshar's mines to grind - this is not an
+</p>
+<p> easy game, but it is definitively fun, specially with friends.
+</p>
+<p>
+</p>
+<p> Our Game Masters often arrange <b>events</b> which are announced by Discord/IRC!
+</p>
+<p> There is also a <b>Daily Login Bonus</b>, to encourage you to keep playing!
+</p>
+<p> Please bear the development stages with us. There are balance problems, and
+</p>
+<p> various items are NPC-Only, and even bugs could be lurking here and there -
+</p>
+<p> give us feedback at #world channel and, who knows, you may be rewarded if you
+</p>
+<p> find a bug!
+</p>
+<p>
+</p>
+<p> We want to express our gratitude here to Saulc, for sponsoring this server.
+</p>
+<p> We also want to thanks to all testers: Thanks, you've did a great job!
+</p>
+<p> And by last, our gratitude to every developer and contributor who made this possible!
+</p>
+<p>
+</p>
+<p> Enjoy gaming, and leave feedback at Discord!
+</p>
+<p> The second release is already being baked!
+</p>
+<p>
+</p>
+<p> -- Your TMW2 Team
+</p>
+<p> March 2018
+</p>
+<p>
+</p>
+<p> You can check out this page for older entries:
+</p>
+<p> <a href="http://tmw2.org/news.html">http://tmw2.org/news</a>
+</p>
+]]></content>
+ </entry>
+
+
+
+</feed>
diff --git a/web/newsfeed.py b/web/newsfeed.py
new file mode 100755
index 0000000..91c6898
--- /dev/null
+++ b/web/newsfeed.py
@@ -0,0 +1,98 @@
+#! /usr/bin/env python
+# -*- coding: utf8 -*-
+#
+# Copyright (C) 2018 The Mana World 2
+# Author: Jonatas N. (Jesusalva)
+
+import datetime
+date=str(datetime.date.today())
+fulldate=str(datetime.datetime.utcnow().isoformat())
+
+# Open file (Dt) and export to "old". (Src) is current news
+dt=open("nf_main.xml", "r")
+old=[]
+for line in dt:
+ old.append(line)
+dt.close()
+dt=open("nf_main.xml", "w")
+src=open("../update/news.txt", "r")
+
+
+# Read news and prepare header
+ns=open("../update/news.txt", "r")
+
+
+# Function to markup it, and strip new lines
+def markup(r):
+ r=r.replace('##0', '')
+ r=r.replace('##1', '')
+ r=r.replace('##2', '')
+ r=r.replace('##3', '')
+ r=r.replace('##4', '')
+ r=r.replace('##5', '')
+ r=r.replace('##6', '')
+ r=r.replace('##7', '')
+ r=r.replace('##8', '')
+ r=r.replace('##9', '')
+ r=r.replace('##B', '<b>')
+ r=r.replace('##b', '</b>')
+ r=r.replace('[@@', '<a href="')
+ r=r.replace('|', '">')
+ r=r.replace('@@]', '</a>')
+ return r
+def nn(r):
+ return r.replace('\n', '')
+
+# Write the news, and close that file
+dt.write(' <entry>\n')
+for i in src:
+ if ('##0 Actual Release: ##1' in i):
+ dt.write('\
+ <title>'+nn(i.replace('##0 Actual Release: ##1',''))+'</title>\n\
+ <link href="https://tmw2.org/news#'+date+'"/>\n\
+ <updated>'+fulldate+'</updated>\n\
+ <id>tag:tmw2.org,'+date+'</id>\n\
+ <content type="html"><![CDATA[')
+ else:
+ dt.write('<p>'+markup(i)+'</p>\n')
+dt.write("]]></content>\n </entry>")
+
+dt.write('\n\n')
+
+for i in old:
+ dt.write(i)
+
+src.close()
+dt.close()
+
+# Open main file as (Dt) and read from (Ns)
+dt=open("feed.xml", "w")
+ns=open("nf_main.xml", "r")
+
+# headers
+dt.write('\
+<?xml version="1.0" encoding="utf-8"?>\n\
+<feed xmlns="http://www.w3.org/2005/Atom">\n\
+ <title>TMW2</title>\n\
+ <link href="https://tmw2.org/feed.xml" rel="self"/>\n\
+ <link href="https://tmw2.org"/>\n\
+')
+dt.write(' <updated>'+fulldate+'</updated>\n')
+dt.write('\
+ <id>https://tmw2.org</id>\n\
+ <author>\n\
+ <name>TMW2 Project</name>\n\
+ <email>admin@tmw2.org</email>\n\
+ </author>\n\
+')
+
+# Write data
+for i in ns:
+ dt.write(i)
+
+# close
+dt.write('\n</feed>')
+
+dt.close()
+ns.close()
+
diff --git a/web/nf_main.xml b/web/nf_main.xml
new file mode 100644
index 0000000..2270b91
--- /dev/null
+++ b/web/nf_main.xml
@@ -0,0 +1,91 @@
+ <entry>
+ <title> 01.5 - Can I Break This Pipeline?</title>
+ <link href="https://tmw2.org/news#2018-03-02"/>
+ <updated>2018-03-06T01:56:59.145089</updated>
+ <id>tag:tmw2.org,2018-03-02</id>
+ <content type="html"><![CDATA[<p> Welcome to <b>TMW-2: Monster Wars</b>!
+</p>
+<p> By playing you agree and abide to the <b>Terms of Service</b>, available at:
+</p>
+<p> <a href="https://tmw2.org/legal.php">https://tmw2.org/legal.php</a>
+</p>
+<p> Last ToS update: 2018-02-24
+</p>
+<p>
+</p>
+<p> Our Staff will never ask for your password. You are the sole responsible for
+</p>
+<p> its safety!
+</p>
+<p> If you ever run in trouble, try contacting a GM with <b>@request Help me!</b>
+</p>
+<p> Please enjoy our server, and have fun!
+</p>
+<p>
+</p>
+<p> Latest release: <b>2018-03-04</b> (Easter stuff, bug fixes)
+</p>
+<p> Never miss a release! Follow our <a href="https://discord.gg/BQNTe68">Discord Channel</a>!
+</p>
+<p>
+</p>
+<p> Your head aches. Your vision is dizzy. A ship appears in your front. Oh no,
+</p>
+<p> please don't tell me this is Evol!
+</p>
+<p>
+</p>
+<p> You may meet familiar faces and/or names, and even places you think that you
+</p>
+<p> know, but don't be fooled - things are different here, and work different here.
+</p>
+<p> Awake in Nard ship, visit Candor, journey to Tulimshar - the game offers the
+</p>
+<p> basic stuff a MMORPG needs. Use Tulimshar's mines to grind - this is not an
+</p>
+<p> easy game, but it is definitively fun, specially with friends.
+</p>
+<p>
+</p>
+<p> Our Game Masters often arrange <b>events</b> which are announced by Discord/IRC!
+</p>
+<p> There is also a <b>Daily Login Bonus</b>, to encourage you to keep playing!
+</p>
+<p> Please bear the development stages with us. There are balance problems, and
+</p>
+<p> various items are NPC-Only, and even bugs could be lurking here and there -
+</p>
+<p> give us feedback at #world channel and, who knows, you may be rewarded if you
+</p>
+<p> find a bug!
+</p>
+<p>
+</p>
+<p> We want to express our gratitude here to Saulc, for sponsoring this server.
+</p>
+<p> We also want to thanks to all testers: Thanks, you've did a great job!
+</p>
+<p> And by last, our gratitude to every developer and contributor who made this possible!
+</p>
+<p>
+</p>
+<p> Enjoy gaming, and leave feedback at Discord!
+</p>
+<p> The second release is already being baked!
+</p>
+<p>
+</p>
+<p> -- Your TMW2 Team
+</p>
+<p> March 2018
+</p>
+<p>
+</p>
+<p> You can check out this page for older entries:
+</p>
+<p> <a href="http://tmw2.org/news.html">http://tmw2.org/news</a>
+</p>
+]]></content>
+ </entry>
+
+