Extend your community

Long-Polling Event Comments Stream

GET /2/event_comments
  • json
Host: stream.meetup.com
  • public
stream version 1

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.

Request Parameters

These parameters are set automatically by Meetup's must.js client.

callback

Name of a function to be called with an array of Event Comment notification objects. If this parameter is not supplied, the chunked stream is joined instead.

event_id

Limit notifications to a specific event id. Use alphanumeric ids for repeating events.

since_count

Request that some number of recent messages be sent immediately, if available. May not be specified in the same request as since_mtime.

since_mtime

Should be supplied for all but the first polling request, so that any missed notifications are can be sent in an immediate response

Response

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.

comment

The comment text

event

Event comment was posted in

event_id

Unique numeric id

event_name

Name of the event

group

Group hosting the event

group_city

Group's home city

group_country

two-letter code of group's home country

group_id

Numeric identifier of the group

group_lat

Latitude of group's approximate location

group_lon

Longitude of group's approximate location

group_name

-

group_state

two-letter code of group's home state, if in US or CA

group_urlname

Unique portion of group's URL, no slashes

id

Unique numeric identifier

member

Member who posted the comment

member_id

Unique numeric id

member_name

Full name given

photo

If available, the photo of the member posting the comment

mtime

Last modified time of this event comment, in milliseconds since the epoch

status

Set to 'active' or 'deleted'. Comments are republished to the stream when members delete them, so that apps may update their local comment display.

Errors

connection_limit

the client IP has exceeded its maximum number of connections

Examples

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>

WebSockets Event Comments Stream

WS /2/event_comments
  • json
Host: stream.meetup.com
  • public
stream version 1

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.

Request Parameters

The full URL for this method is ws://stream.meetup.com/2/event_comments

event_id

Limit notifications to a specific event id. Use alphanumeric ids for repeating events.

since_count

Request that some number of recent messages be sent immediately, if available. May not be specified in the same request as since_mtime.

since_mtime

Return recent Event Comments with an mtime greater than the supplied time, in milliseconds since the epoch

Response

This stream includes the same JSON notification objects as its long-polling counterpart, one per WebSocket frame.

Errors

connection_limit

the client IP has exceeded its maximum number of connections

Examples

The long-polling stream examples will automatically use WebSockets, if available.

Chunked HTTP Event Comments Stream

GET /2/event_comments
  • json
Host: stream.meetup.com
  • public
stream version 1

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.

Request Parameters

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.

event_id

Limit notifications to a specific event id. Use alphanumeric ids for repeating events.

since_count

Request that some number of recent messages be sent immediately, if available. May not be specified in the same request as since_mtime.

since_mtime

Return recent Event Comments with an mtime greater than the supplied time, in milliseconds since the epoch

Response

This stream includes the same JSON notification objects as its long-polling counterpart. These are served one per HTTP chunk and terminated by newlines.

Errors

connection_limit

the client IP has exceeded its maximum number of connections

Examples

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.

API methods