#!/usr/bin/python3 # -*- coding: UTF-8 -*- # # # Examples: # # http://live.quantumapalooza.com/?showTimeZone=GMT-4&force=1 # # http://live.quantumapalooza.com/?search=Gupta # # logFile = "/dev/null" logFile = "/tmp/x" # enable debugging import cgitb cgitb.enable() import sys import os import os.path from os import path import requests from xml.etree.ElementTree import Element, SubElement, Comment, tostring from urllib.parse import urlparse, parse_qs, urlsplit import random #sys.path.insert(0, '/var/www/html/vol01/quantumBase/bin/') import json import lib import cgi import requests print("Expires: 0;") print("Cache-Control: no-cache;") print("Pragma: no-cache;") print("Content-type: application/rss+xml;") print("") myDir = lib.pwd() myDir = lib.getLastDirString(myDir) CCYY = lib.CCYYMMDDHHMMSSMMMMMM()[0:4] print(f''' Harrisburg Quantum Quantumapalooza.com http://live.quantumapalooza.com Global list of free online events on quantum technologies and industry Copyright {CCYY} Harrisburg University ''') inLines = lib.LIBloadRecData() #inLines = lib.convertRecNumToRecId(inLinesOrig) for i in inLines: lib.buildVirtualFields(inLines[i]) oldDbEvents = {} linesByKey = {} for i in inLines: # key = lib.formDatesKey(inLines[i],i) key = inLines[i]["SORTORDER_CHRONOLOGICAL_KEYDATETIME_USER_TZ"]+str(1000000+int(i)) inLines[i]["SORTORDER_CHRONOLOGICAL_KEYDATETIME_USER_TZ_RECNUM"] = key linesByKey[key] = i #sortedInLines = sorted(inLines.items(), key=lambda x: int(x[0])) linesByKeySorted = sorted(linesByKey.keys()) rssSlurp = '' currentCCYYMMDDHHMM = lib.CCYYMMDDHHMMSSMMMMM_NOW_USER_TZ()[0:12] currentCCYYMMDD = currentCCYYMMDDHHMM[0:8] #rssSlurp += "\n" currentDate = "00000000" numCurrentEvents =0 for recKey in linesByKeySorted: recNum = linesByKey[recKey] z = inLines[recNum] displayUntil = z.get("END_CCYYMMDDHHMM_USER_TZ","999999999999") if lib.wantEventDisplayNotFinishedBy(displayUntil,currentCCYYMMDDHHMM): pRecord = lib.processRecordRSS(z,recNum,recKey) numCurrentEvents += 1 recDate = z.get("START_CCYYMMDD_USER_TZ","00000000") if recDate < currentCCYYMMDD: recDate = currentCCYYMMDD if recDate != currentDate: currentDate = recDate # rssSlurp += "
"+lib.dayDateFormatStr(currentDate)+"
\n" rssSlurp += pRecord + "\n" rssSlurp = lib.cleanSlurp2(rssSlurp) print(rssSlurp) print('
\n
') lib.logUrlHit(lib.pwd())