This long-polling stream can be easily consumed using JavaScript in any modern browser. Event Comment notifications are received when they happen, or as soon as your script finishes handling its last notification.
These parameters are set automatically by Meetup's must.js client.
Event Comment notification objects include these properties. This method's response is an array of zero or more of these, while Meetup's JS client calls your callback function with exactly one object.
Install the Meetup stream client with bower
$ bower install must
The HTML page draws a table of Event Comments as they are received.
<html>
<head>
<script src="components/jquery/jquery.min.js"></script>
<script src="components/must/must.js"></script>
<script>
must.Comments(function(comment) {
$('#comments').prepend(
'<tr><td>' + comment.member.member_name +
'</td><td>' + new Date(comment.mtime) +
'</td><td>' + comment.comment +
'</td></tr>'
);
});
</script>
</head>
<body>
<table><thead>
<tr><th>Who</th><th>When</th><th>What</th></tr>
</thead><tbody id="comments">
</tbody></table>
</body>
</html>
For browsers that support it, WebSockets is a more efficient alternative to the long-polling stream. This is a push only endpoint and will discard any messages received from the client after the socket is open.
Because browser support for WebSockets is limited, we recommend that you consume this stream through the must.js client, which can fallback to long-polling.
The full URL for this method is ws://stream.meetup.com/2/event_comments
This stream includes the same JSON notification objects as its long-polling counterpart, one per WebSocket frame.
The long-polling stream examples will automatically use WebSockets, if available.
Live HTTP stream of Event Comments within public meetup groups. This method uses chunked transfer encoding to maintain a persistent connection with the client. This connection will only be terminated for server maintenance or a connection error.
This method does not require authentication, or any parameters. Applications should only need a single connection to the stream, and at most 10 connections are allowed per client IP address.
This stream includes the same JSON notification objects as its long-polling counterpart. These are served one per HTTP chunk and terminated by newlines.
Try out the Event Comments stream on a command line:
curl -i http://stream.meetup.com/2/event_comments
If your system doesn't have curl, you can also use wget:
wget -qO- http://stream.meetup.com/2/event_comments
An application using the stream should keep track of the last Event Comment mtime it has received, so that when disconnected it may resume where it left off:
curl -i http://stream.meetup.com/2/event_comments?since_mtime=1294435118533
The number of past Event Comments the stream will return is limited. Applications that intend to consume all Event Comment activity should reconnect within a few seconds to avoid missing Event Comment messages.