Commit aac6b60b authored by Koen Martens's avatar Koen Martens

Add The Encore Escape grid

parent c3a44353
import requests
from lib.event import Event
from fetcher.icalfetcher import IcalFetcher
import icalendar
from lib.category import Category
from helper.theencoreescape import TheEncoreEscapeHelper
class TheEncoreEscapeFetcher(IcalFetcher):
def __init__(self, eventlist, webcache=None):
super(TheEncoreEscapeFetcher,self).__init__(
"https://calendar.google.com/calendar/ical/theencoreescape%40gmail.com/public/basic.ics",
[Category("grid-theencoreescape")],
eventlist,
webcache,
TheEncoreEscapeHelper()
)
self.webcache = webcache
self.minexpiry = 1000
self.maxexpirty = 1800
if __name__=='__main__':
from lib.webcache import WebCache
from lib.eventlist import EventList
eventlist = EventList()
cache = WebCache("data/test_theencoreescape.cache")
f = TheEncoreEscapeFetcher(eventlist, cache)
f.fetch()
cache.flush()
for ev in eventlist:
print str(ev)
import re
from helper import Helper
from datetime import timedelta
class TheEncoreEscapeHelper(Helper):
cancelled_re = re.compile("cancel", flags=re.I)
def customizeEvent(self, event):
event = super(TheEncoreEscapeHelper, self).customizeEvent(event)
if len(event.title)==0:
return None
if self.__class__.cancelled_re.search(event.title):
return None
if event.end - event.start > timedelta(hours=6):
return None
return event
......@@ -133,6 +133,7 @@
case "arcana": rv = "Arcana"; break;
case "thirdlife": rv = "3rdLifeGrid"; break;
case "islandoasis": rv = "Island Oasis Grid"; break;
case "theencoreescape": rv = "The Encore Escape"; break;
default: rv = null; break;
}
return rv;
......
......@@ -13,11 +13,10 @@
<span id="headerHYP">HYP</span><span id="headerEvents">Events</span>
</div>
<div class="mainrow" id="news">
<div class="newsitem">2017-03-15: New grid - The Encore Escape - added</div>
<div class="newsitem">2017-01-24: Added OneMoreGrid.com's event calendar</div>
<div class="newsitem">2016-11-04: Added Island Oasis Grid events</div>
<div class="newsitem">2016-10-29: New version of in-world board, 0.8, released</div>
<div class="newsitem">2016-09-19: Added calendar from 3rdLifeGrid</div>
<div class="newsitem">2016-02-03: New calendar from the Arcana grid added</div>
</div>
<div class="mainrow" id="menu">
<ul>
......@@ -91,8 +90,10 @@ If, for some reason, an ical feed or json provider is not an option (or there is
<p>The following calendars are imported:</p>
<ul>
<li><a href="http://3rdlifegrid.com/">3rdLifeGrid</a></li>
<li><a href="http://opensimworld.com/hop/76099-Arcana">Arcana</a></li>
<li><a href="http://avatarfest.net/">AVATARfest</a></li>
<li><a href="http://www.craft-world.org/">Craft World</a></li>
<li><a href="https://theencoreescape.com/">The Encore Escape</a></li>
<li><a href="http://exo-life.onl/">Exo-Life Virtual World</a></li>
<li><a href="http://francogrid.org/">FrancoGrid</a></li>
<li><a href="http://greatcanadiangrid.ca/">Great Canadian Grid</a></li>
......@@ -111,7 +112,6 @@ If, for some reason, an ical feed or json provider is not an option (or there is
<li><a href="http://3rdrockgrid.com/">Third Rock Grid</a></li>
<li><a href="http://www.vhs-sl.de/fr_hypergrid-eventkalender.htm">VHS Goslar</a></li>
<li><a href="http://zangrid.ch/">ZanGrid</a></li>
<li><a href="http://opensimworld.com/hop/76099-Arcana">Arcana</a></li>
</ul>
<h2>Why isn't grid XYZ on the calendar?</h2>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment