|
@@ -6,13 +6,15 @@ import re
|
|
|
|
|
|
|
|
def get_events():
|
|
def get_events():
|
|
|
"""Simply retrieve events"""
|
|
"""Simply retrieve events"""
|
|
|
- query = """SELECT * FROM events
|
|
|
|
|
- WHERE timestamp BETWEEN now() - INTERVAL '24 HOURS' AND now()
|
|
|
|
|
- AND (news LIKE '% sent an application to join the Faction.'
|
|
|
|
|
- OR news LIKE '% left the faction.'
|
|
|
|
|
- OR news LIKE '% has accepted %'
|
|
|
|
|
- OR news LIKE '% has declined %')
|
|
|
|
|
- ORDER BY timestamp DESC;"""
|
|
|
|
|
|
|
+ query = """SELECT * FROM
|
|
|
|
|
+ (SELECT * FROM events
|
|
|
|
|
+ WHERE timestamp BETWEEN now() - INTERVAL '24 HOURS' AND now()
|
|
|
|
|
+ AND (news LIKE '% sent an application to join the Faction.'
|
|
|
|
|
+ OR news LIKE '% left the faction.'
|
|
|
|
|
+ OR news LIKE '% has accepted %'
|
|
|
|
|
+ OR news LIKE '% has declined %')
|
|
|
|
|
+ ORDER BY timestamp DESC) tmp
|
|
|
|
|
+ ORDER BY timestamp;"""
|
|
|
return query
|
|
return query
|
|
|
|
|
|
|
|
|
|
|