Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP meetup.com API client allowing sweet and simple access to Meetup API methods.
PHP JavaScript Other

Merge pull request #5 from mixedconnections/master

Adding class for cities method
Failed to load latest commit information.
debug/krumo Wrote the rest of the API classes that I
libraries/xmlrpc More changes. Made patch for jsonrpc library.
.gitattributes Added .gitattributes so I can build a release
.gitignore Wrote the rest of the API classes that I
GPL.txt Added the GPL so I can host on GitHub (important!)
MeetupAPIBase.php Workaround for json_decode issue with large numbers
MeetupAPICities.php Adding class for API method cities
MeetupAPIComments.php Added the GPL so I can host on GitHub (important!)
MeetupAPIEvents.php Wrote the rest of the API classes that I
MeetupAPIGroups.php Wrote the rest of the API classes that I
MeetupAPIMembers.php Wrote the rest of the API classes that I
MeetupAPIOpenEvents.php Adding class for API method open_events
MeetupAPIProfilesv2.php Wrote the rest of the API classes that I
MeetupAPIRsvps.php Wrote the rest of the API classes that I
README.txt
config.php Updated API_FORMAT comment text.
meetup_api_setPageSize_fix_20101024.patch Allow MeetupAPIBase::pageSize to be set to 0.
meetup_api_sortdesc_fix_20100920.patch Fixed descending sort option. Patch created.

README.txt

Last updated 7 June 2011 by Mike Accardo <accardo [at] cpan [dot] org>

=== Introduction to using the Meetup API ===

Here's an example of making a call to Comments.

  <?php
    $test_key = 'yourkeyhere'; //Replace with your key
    $muApi = new MeetupAPIComments($test_key);
    $muApi->setQuery( array('group_urlname' => 'some-group-urlname',) ); //Replace with a real group's URL name - it's what comes after the www.meetup.com/
    set_time_limit(0);
    $muApi->setPageSize(200);
    $response = $muApi->getResponse();
    krumo($response);
  ?>

=== Example of dealing with UTC time ===

Here's an example of converting the UTC time field. 

In some API methods, like open events, the response returns a time and offset. The time is UTC time in milliseconds since the epoch, and the offset is the local offset from UTC time in milliseconds. 

In the MeetupAPIBase class, the UTC time is automatically divided by 1000. So in the example, we only have to divide the offset by 1000 to complete the conversion.    

  <?php

    date_default_timezone_set('UTC');

    // Get the response after making a request as shown in the first example
    $response = $muApi->getResponse();
    foreach($response->{"results"} as $event)
    {  
        $time = $event->{'time'};
	$offset = $event->{'utc_offset'}/1000;
	$time = date('Y-m-d H:i:s',$time + $offset);
    }
  ?>

=== Using unimplemented methods ===

This is totally possible. The MeetupAPIBase class is pretty rich and does most of the work. So you can either:

1. Copy and change one of the existing classes - just change the class name and the method called in the constructor. If you do this, please contribute back the new class, as it would be nice to have them all implemented.
2. Instantiate MeetupAPIBase directly. This is fine to do. For example:
  $muApi = new MeetupAPIBase($test_key, 'comments');
The previous line does the same thing as instantiating the MeetupAPIComments class, at least at the time of writing.

=== Future plans ===
Probably the first thing will be to add more intelligent validation. Right now, it essentially does nothing since the Meetup API itself will return error information to the meta object if there is a problem. But it'd be nice if the API would prevent erroneous requests from being made and thus save some API requests.
Something went wrong with that request. Please try again.