Persistent IRC log storage with S2 compression and real-time WebSocket streaming.
ircstore is a high-performance IRC logging system that:
/api/channels
List all available IRC channels
curl https://ircstore.rotko.net/api/channels
Response:
["#rust", "#linux", "#networking"]
/api/logs/:channel
Retrieve historical logs for a specific channel
Query parameters:
limit - Number of messages (default: 100, max: 1000)offset - Starting offset for pagination (default: 0)curl "https://ircstore.rotko.net/api/logs/%23rust?limit=50&offset=0"
Response:
[
{
"timestamp": 1698765432,
"channel": "#rust",
"nick": "alice",
"message": "anyone familiar with async traits?"
}
]
/ws
Subscribe to real-time IRC messages across all channels
const ws = new WebSocket('wss://ircstore.rotko.net/ws');
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
console.log(`[${msg.channel}] ${msg.nick}: ${msg.message}`);
};
Message format:
{
"timestamp": 1698765432,
"channel": "#rust",
"nick": "alice",
"message": "anyone familiar with async traits?"
}
import requests
import websocket
import json
# Get available channels
channels = requests.get('https://ircstore.rotko.net/api/channels').json()
print(f"Available channels: {channels}")
# Get recent logs
logs = requests.get('https://ircstore.rotko.net/api/logs/%23rust?limit=10').json()
for msg in logs:
print(f"[{msg['nick']}] {msg['message']}")
# Subscribe to real-time updates
def on_message(ws, message):
msg = json.loads(message)
print(f"[{msg['channel']}] {msg['nick']}: {msg['message']}")
ws = websocket.WebSocketApp('wss://ircstore.rotko.net/ws', on_message=on_message)
ws.run_forever()
// Fetch historical logs
async function getLogs(channel, limit = 100) {
const res = await fetch(`/api/logs/${encodeURIComponent(channel)}?limit=${limit}`);
return await res.json();
}
// Real-time subscription
const ws = new WebSocket('wss://ircstore.rotko.net/ws');
const messageHandlers = new Map();
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
const handler = messageHandlers.get(msg.channel);
if (handler) handler(msg);
};
// Subscribe to specific channel
function subscribeToChannel(channel, callback) {
messageHandlers.set(channel, callback);
}
subscribeToChannel('#rust', (msg) => {
console.log(`${msg.nick}: ${msg.message}`);
});
interface IrcEvent {
timestamp: number; // Unix timestamp
channel: string; // IRC channel name
nick: string; // Sender nickname
message: string; // Message content
}
The project is open source and available at github.com/rotkonetworks/ircstore