Giter Site home page Giter Site logo

meetup-api-client-for-php's Introduction

Meetup API client for PHP

Meetup (http://meetup.com) is a social networking site based around community groups. Meetup provides an API to access their platform services from remote applications to manage authentication, events, rsvps and more.

Until now a good PHP client for the Meetup API has not existed. This project aims to bridge that gap by providing a high quality stand alone Meetup API PHP client. This client is simple to use through provided classes and also allows powerful advanced usage through direct queries to the API

NOTE: This project currently only supports GET requests to the Meetup API

Supported endpoints

/2/checkins /2/events /2/event /2/open_events /2/event_comments /2/event_ratings /activity /2/groups /comments /2/members /2/member /2/profiles /2/photo_comments /2/photo_albums /2/photos /2/rsvps /topics /2/open_venues /2/venues

Documentation

Full documentation can be found on the Github project wiki at https://github.com/blobaugh/Meetup-API-client-for-PHP/wiki

How to setup the library

  • Download the files from Github and place them in the PHP application directory
    • I.E. /var/www/myapp/Meetup-API-client-for-PHP
  • Include the Meetup.php file in your application
    • I.E. In /var/www/myapp/index.php
    • Use require_once('Meetup-API-client-for-PHP/Meetup.php');
  • Establish a connection to the API with your Meetup API key, available at http://www.meetup.com/meetup_api/key/
    • $meetup_api_key = '';
    • $connection = new MeetupKeyAuthConnection($meetup_api_key);
  • Begin using the new Meetup functionality in your application!

Using the pre-built endpoint classes

The Meetup API client for PHP allows developers to make direct calls to the Meetup API, however for convenience several helper classes have been created. Each class corresponds directly to a grouping of endpoints from the Meetup API documentation. These classes take an associative array of parameters that correspond to the parameters in the Meetup API documentation.

Example: Accessing all Meetup events for user Ben Lobaugh with ID 14508967. See http://www.meetup.com/meetup_api/docs/2/events/ for additional parameters and response format

$m = new MeetupEvents($connection); $events = $m->getEvents( array( 'member_id' => '14508967' ) );

$events will be in the form of an associative array

Consult the Meetup API documentation for parameters used by each endpoint http://www.meetup.com/meetup_api/docs

Direct queries to the Meetup API

The Meetup API client for PHP supports direct API queries if a helper class is not available. Queries are sent to the MeetupApiRequest class and data recieved from the Meetup API will be returned in the MeetupApiResponse class. The MeetupApiResponse object will contain the HTTP code and API response. To use the MeetupApiReponse class a developer simply calls the query method with an endpoint and parameters.

Example: Accessing all Meetup events for user Ben Lobaugh with ID 14508967. See http://www.meetup.com/meetup_api/docs/2/events/ for additional parameters and response format

$m = new MeetupApiRequest($connection); $events = $m->query( MEETUP_ENDPOINT_EVENTS, array( 'member_id' => '14508967' ) );

$events will be a MeetupApiResponse object that can be access like an array (E.G. $events['results']) or used in a loop to view each event entry (E.G. foreach( $events AS $event ) ) The HTTP response code can be checked with $events->getHttpCode()

Exceptions

Exceptions will usually occur when an invalid API request is recieved. The following is a list of all the Meetup API client for PHP specific exceptions

  • MeetupInvalidParametersException - Invalid or missing parameters passed to the API endpoint
  • MeetupBadRequestException - Problem with the request
  • MeetupUnauthorizedRequestException - Invalid API key
  • MeetupInternalServerErrorException - Problem exists with the Meetup API server

Development Roadmap

  • oAuth integration - High priority
  • POST support
  • everywhere endpoints implementation

If you would like to see specific new developments please feel free to contribute through code of financial incentives.

meetup-api-client-for-php's People

Contributors

cjlarose avatar blobaugh avatar desmondmorris avatar rdohms avatar

Watchers

Benjamin avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.