-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinfo.py
135 lines (126 loc) · 3.81 KB
/
info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import room
def info():
roomIsOpen = room.isRoomOpen()
message = {
'api': '0.12',
'space': 'Hickerspace',
'url': 'https://hickerspace.org',
'icon': {
'open': 'https://hickerspace.org/images/open.png',
'closed': 'https://hickerspace.org/images/closed.png'
},
'address': 'Kulturfabrik Loeseke (Projektwerkstatt), Langer Garten 1, 31137 Hildesheim, Germany',
'lat': 52.16175,
'lon': 9.957776,
'contact': {
'irc': 'irc://irc.freenode.net:6667/#hickerspace',
'twitter': '@hickernews',
'jabber': 'hick@conference.hickerspace.org',
'email': 'kontakt@hickerspace.org',
'ml': 'hickerspace@hickerspace.org'
},
'logo': 'https://hickerspace.org/images/hickerspace.png',
'status': infoMessage(roomIsOpen),
'lastchange': room.getStatus()['since'],
'open': roomIsOpen,
'icon': {
'open': 'https://hickerspace.org/images/open.png',
'closed': 'https://hickerspace.org/images/closed.png'
},
'feeds': [
{
'name': 'News via Twitter',
'type': 'application/rss+xml',
'url': 'http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=hickernews'
},
{
'name': 'New Wiki Articles',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/New.xml'
},
{
'name': 'Wiki Articles Updated Lately',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/Updated.xml'
},
{
'name': 'Wiki Articles in Userspace Updated Lately',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/Userspace.xml'
},
{
'name': 'Wiki Articles Discussed Lately',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/Discussion.xml'
},
{
'name': 'Event Calendar',
'type': 'text/calendar',
'url': 'https://hickerspace.org/wiki/Spezial:Semantische_Suche/-5B-5BTermin:%2B-5D-5D/-3FVollerTitel%3Dsummary/-3FDatum%3Dstart/-3FEnddate%3Dend/format%3Dicalendar/limit%3D200/searchlabel%3DKalender-20abonnieren-20(iCalendar-2DFormat)/offset%3D0'
}
]
}
return message
def info_0_13_draft():
roomIsOpen = room.isRoomOpen()
message = {
'api': '0.13',
'space': 'Hickerspace',
'url': 'https://hickerspace.org',
'icon': {
'open': 'https://hickerspace.org/images/open.png',
'closed': 'https://hickerspace.org/images/closed.png'
},
'location': {
'address': 'Kulturfabrik Loeseke (Projektwerkstatt), Langer Garten 1, 31137 Hildesheim, Germany',
'lat': 52.16175,
'lon': 9.957776
},
'contact': {
'irc': 'irc://irc.freenode.net:6667/#hickerspace',
'twitter': '@hickernews',
'jabber': 'hick@conference.hickerspace.org',
'email': 'kontakt@hickerspace.org',
'ml': 'hickerspace@hickerspace.org'
},
'logo': 'https://hickerspace.org/images/hickerspace.png',
'status': {
'open': roomIsOpen,
'lastchange': room.getStatus()['since'],
'message': infoMessage(roomIsOpen),
'icon': {
'open': 'https://hickerspace.org/images/open.png',
'closed': 'https://hickerspace.org/images/closed.png'
}
},
'feeds': [
{
'name': 'News via Twitter',
'type': 'application/rss+xml',
'url': 'http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=hickernews'
},
{
'name': 'New Wiki Articles',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/New.xml'
},
{
'name': 'Wiki Articles Updated Lately',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/Updated.xml'
},
{
'name': 'Wiki Articles in Userspace Updated Lately',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/Userspace.xml'
},
{
'name': 'Wiki Articles Discussed Lately',
'type': 'application/rss+xml',
'url': 'https://hickerspace.org/wiki/Discussion.xml'
}
]
}
return message
def infoMessage(roomIsOpen):
return 'Open for public!' if roomIsOpen else 'We\'re closed.'