Commit caece5ee authored by Gudule Lapointe's avatar Gudule Lapointe

* added The Factory/The BirdCage

parent e78c52d4
import requests
from lib.event import Event
from fetcher.icalfetcher import IcalFetcher
import icalendar
from lib.category import Category
from helper.thefactory import TheFactoryHelper
class TheFactoryFetcher(IcalFetcher):
def __init__(self,eventlist,webcache=None):
super(TheFactoryFetcher,self).__init__(
"https://calendar.google.com/calendar/ical/ernestmoncrieff54%40gmail.com/private-57530a1e03a7fd303d8ef3ff7436cd00/basic.ics",
[Category("grid-thefactory")],
eventlist,
webcache,
TheFactoryHelper()
)
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_thefactory.cache")
f = TheFactoryFetcher(eventlist, cache)
f.fetch()
cache.flush()
for ev in eventlist:
print str(ev)
import re
import pickle
from datetime import timedelta
from helper import Helper
class TheFactoryHelper(Helper):
hgre = re.compile("^[^:]+:[0-9]+:[^:]+$")
def findRegion(self, data):
if data==None or data=='' or data=='-':
return 'hg.osgrid.org:80:The Factory'
return None
def customizeEvent(self, event):
event = super(TheFactoryHelper, self).customizeEvent(event)
hgurl = self.findRegion(event.hgurl)
if hgurl != None:
event.hgurl = hgurl
return event
......@@ -16,6 +16,7 @@
<!-- <span class="brand"><b>2</b>DO</span><span class=ext>.pm</span> <span class=subtitle> across the Metaversum</span> -->
</div>
<div class="mainrow" id="news">
<div class="newsitem">2020-06-27: <strong><a href=http://2do.pm/events/>Added The Factory calendar</div>
<div class="newsitem">2020-06-05: <strong><a href=http://2do.pm/events/>Added Virtual Gay Pride calendar</div>
<div class="newsitem">2020-05-06: <strong><a href=http://2do.pm/events/>Added Ocean Grid calendar</div>
<div class="newsitem">2019-06-03: <strong><a href=http://2do.pm/events/>Added Tranquility Grid calendar</div>
......
......@@ -27,6 +27,7 @@ from lib.eventlist import EventList
# added by later fetchers that are already fetched earlier
# will be discarded
fetchers = [
("thefactoryfetcher", "TheFactoryFetcher", 0),
("virtualgaypridefetcher", "VirtualGayPrideFetcher", 0),
("oceangridfetcher", "OceanGridFetcher", 0),
("tranquilitygridfetcher", "TranquilityGridFetcher", 0),
......
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