rdohms/meetup-api-client
Fork: 26 Star: 77 (更新于 1970-01-01 00:00:00)
license: MIT
Language: PHP .
Guzzle powered Meetup.com API Client
最后发布版本: v2.4.0 ( 2019-09-01 16:25:55)
This Library is no longer maintained
Due to Meetup.com changing their policies making their API a paid product, I believe it is not fair to expect Open Source Developers like me to maintain clients for it's API for Free.
Thus this library will no longer be updated, the v3 rewrite will be abandoned.
Sorry, I hope you all find a new house for your meetups, but if you stay on meetup.com i hope other libs can offer you the needed features.
DMS Meetup.com API Client
This is a client for the Meetup.com API powered by the Guzzle Project.
Installation
The library is available through Composer, so its easy to get it. Just Run this:
composer require dms/meetup-api-client
Features
- All documented and non-deprecated methods from:
- Meetup API v3
- Meetup API v2
- Legacy v1, except methods tagged as deprecated
- Key authentication
- OAuth 1.0 Authentication
- OAuth 2.0 Authentication
- POST, GET and DELETE methods
Usage
To use the API Client simply instantiate the preferred client (key auth or OAuth), giving it the correct parameters
<?php
// Key Authentication
$client = MeetupKeyAuthClient::factory(array('key' => 'my-meetup-key'));
// OAuth Authentication
$config = array(
'consumer_key' => 'consumer-key',
'consumer_secret' => '*****',
'token' => '*****',
'token_secret' => '*****',
);
$client = MeetupOAuthClient::factory($config);
// OAuth2 Authentication
$config = array(
'access_token' => 'access_token',
);
$client = MeetupOAuth2Client::factory($config);
Invoke Commands using our __call
method (auto-complete phpDocs are included)
<?php
$client = MeetupKeyAuthClient::factory(array('key' => 'my-meetup-key'));
// Use our __call method (auto-complete provided)
$response = $client->getRsvps(array('event_id' => 'the-event-id'));
foreach ($response as $responseItem) {
echo $responseItem['member']['name'] . PHP_EOL;
}
Or Use the getCommand
method:
<?php
$client = MeetupKeyAuthClient::factory(array('key' => 'my-meetup-key'));
//Retrieve the Command from Guzzle
$command = $client->getCommand('GetRsvps', array('event_id' => 'the-event-id'));
$command->prepare();
$response = $command->execute();
foreach ($response as $responseItem) {
echo $responseItem['member']['name'] . PHP_EOL;
}
For a list of all the available commands, see the Meetup API documentation on ReadTheDocs
Response
This wrapper implements two types of custom responses to facilitate the usage of the results directly.
Response for Collection
When querying for collections the client wraps the result in a MultiResultResponse
. This response implements a Iterator
allowing you to directly iterate over the results, while still giving you access to all response data, as well as the metadata returned by the API using the getMetaData()
method.
<?php
$rsvps = $client->getRsvps(array('event_id' => 'the-event-id'));
foreach ($rsvps as $rsvp) {
echo $rsvp['member']['name'] . PHP_EOL;
}
$metadata = $response->getMetaData();
echo "Debug Url:" . $metadata['url'];
Response for Single Resource
When getting information of a single resource the client will wrap that in a SingleResultResponse
. This response gives you direct array access to results, but retains response data so you can still access it.
<?php
$rsvp = $client->getRsvp(array('id' => 'rsvp-id'));
echo "RSVP? " . $rsvp['response'];
echo "StatusCode: " . $rsvp->getStatusCode();
Rate Limiting
A rate limiter is included in this client, its enabled by default, but can be disabled as described below. It uses a pre-defined factor (50% by default) to determine when it should start throttling the calls, by using a sleep slowdown. Operations are based on the X-RateLimit-*
headers, to determine remaining limits and reset times.
Configuring Rate Limit Kick-in Factor
To configure how late the back algorithm kicks in, you can set a custom rate factor:
<?php
$client = MeetupKeyAuthClient::factory(array(
'key' => 'my-meetup-key',
'rate_limit_factor' => 0.75
));
Disabling Rate Limiting
If you do not wish to use Rate Limiting and deal with errors sent by the API yourself, use the config below.
<?php
$client = MeetupKeyAuthClient::factory(array(
'key' => 'my-meetup-key',
'disable_rate_limiting' => true
));
License
The API client is available under an MIT License.
最近版本更新:(数据更新于 1970-01-01 00:00:00)
2019-09-01 16:25:55 v2.4.0
2017-12-26 19:07:01 v2.3.1
2016-12-11 18:26:26 v2.3
2016-08-15 05:11:29 v2.2
2016-06-17 22:19:04 v2.1
2015-12-23 21:57:33 v2.0.1
2015-05-03 04:19:48 v2.0.0
2014-12-30 18:59:06 v1.3.0
2014-04-19 02:04:50 v1.2.0
2013-11-13 05:22:33 1.1.1
rdohms/meetup-api-client同语言 PHP最近更新仓库
2024-12-13 19:38:03 coollabsio/coolify
2024-12-13 09:22:46 w7corp/easywechat
2024-12-11 20:15:22 symfony/symfony
2024-11-29 16:49:37 symfony/var-dumper
2024-11-20 23:58:25 laravel/framework
2024-11-20 18:39:23 danielmiessler/SecLists