8000 Finish 2.5.0-rc.1 · redaxeprogrammers/codebird-php@71153b8 · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Commit 71153b8

Browse files
committed
Finish 2.5.0-rc.1
2 parents 8ea20cf + b86a5a0 commit 71153b8

File tree

5 files changed

+700
-539
lines changed

CHANGELOG

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
codebird-php - changelog
22
========================
33

4+
2.5.0 (not yet released)
5+
+ Add section about cacert.pem to README
6+
+ Option to set cURL timeout
7+
+ #42 Allow to get the supported API methods as array
8+
+ #48 Update composer file to jublonet path
9+
+ Update cacert.pem root certificates file
10+
+ #58 support for GET statuses/retweeters/ids
11+
+ #53 Better Proxy HTTP status detection
12+
- #62 Places & Geo API call issue
13+
+ #33 Support internal API methods
14+
+ #59 Support all known API methods
15+
+ Reset bearer token when requesting a new token
16+
+ #61 Return rate limit details with each API call
17+
+ #60 Support uploading multiple media
18+
419
2.4.1 (2013-06-23)
520
+ #26 Stringify null and boolean parameters
621
+ Validate Twitter SSL certificate for oauth2/token method

README.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ codebird-php
22
============
33
*A Twitter library in PHP.*
44

5-
Copyright (C) 2010-2014 Jublo IT Solutions <support@jublo.net>
5+
Copyright (C) 2010-2014 Jublo Solutions <support@jublo.net>
66

77
This program is free software: you can redistribute it and/or modify
88
it under the terms of the GNU General Public License as published by
@@ -145,7 +145,9 @@ $params = array(
145145
$reply = $cb->users_show($params);
146146
```
147147

148-
When **uploading files to Twitter**, the array syntax is obligatory:
148+
### Uploading files to Twitter
149+
150+
The array syntax is obligatory:
149151

150152
```php
151153
$params = array(
@@ -155,6 +157,44 @@ $params = array(
155157
$reply = $cb->statuses_updateWithMedia($params);
156158
```
157159

160+
#### Multiple images
161+
can be uploaded in a 2-step process. **First** you send each image to Twitter, like this:
162+
```php
163+
// these files to upload
164+
$media_files = array(
165+
'bird1.jpg', 'bird2.jpg', 'bird3.jpg'
166+
);
167+
// will hold the uploaded IDs
168+
$media_ids = array();
169+
170+
foreach ($media_files as $file) {
171+
// upload all media files
172+
$reply = $cb->media_upload(array(
173+
'media' => $file
174+
));
175+
// and collect their IDs
176+
$media_ids[] = $reply->media_id_string;
177+
}
178+
```
179+
**Second,** you attach the collected media ids for all images to your call
180+
to ```statuses/update```, like this:
181+
182+
```php
183+
// convert media ids to string list
184+
$media_ids = implode(',', $media_ids);
185+
186+
// send tweet with these medias
187+
$reply = $cb->statuses_update(array(
188+
'status' => 'These are some of my relatives.',
189+
'media_ids' => $media_ids
190+
));
191+
print_r($reply);
192+
);
193+
```
194+
Here is a [sample tweet](https://twitter.com/LarryMcTweet/status/475276535386365952) sent with the code above.
195+
196+
More [documentation for tweeting with multiple media](https://dev.twitter.com/docs/api/multiple-media-extended-entities) is available on the Twitter Developer site.
197+
158198
### Requests with app-only auth
159199

160200
To send API requests without an access token for a user (app-only auth),
@@ -211,6 +251,9 @@ rate-limited.
211251
See the [Rate Limiting FAQ](https://dev.twitter.com/docs/rate-limiting-faq)
212252
for more information.
213253

254+
Unless your return format is JOSN, you will receive rate-limiting details
255+
in the returned data’s ```$reply->rate``` property.
256+
214257
6. Return formats
215258
-----------------
216259
The default return format for API calls is a PHP object.
@@ -388,3 +431,25 @@ User must verify login
388431
When this error occurs, advise the user to
389432
[generate a temporary password](https://twitter.com/settings/applications)
390433
on twitter.com and use that to complete signing in to the application.
434+
435+
…know what cacert.pem is for?
436+
-----------------------------
437+
438+
Connections to the Twitter API are done over a secured SSL connection.
439+
Since 2.4.0, codebird-php checks if the Twitter API server has a valid
440+
SSL certificate. Valid certificates have a correct signature-chain.
441+
The cacert.pem file contains a list of all public certificates for root
442+
certificate authorities. You can find more information about this file
443+
at http://curl.haxx.se/docs/caextract.html.
444+
445+
…set the timeout for requests to the Twitter API?
446+
-------------------------------------------------
447+
448+
For connecting to Twitter, Codebird uses the cURL library.
449+
You can specify both the connection timeout and the request timeout,
450+
in milliseconds:
451+
452+
```php
453+
$cb->setConnectionTimeout(2000);
454+
$cb->setTimeout(5000);
455+
```

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"name": "jublonet/codebird-php",
33
"description" : "A Twitter library in PHP.",
4-
"version": "2.4.1",
4+
"version": "2.5.0-rc.1",
55
"autoload": {
66
"classmap": ["src/"]
77
},
8-
"license": "GPL-3.0"
8+
"license": "GPL-3.0",
9+
"require": {
10+
"lib-openssl": "*",
11+
"lib-curl": "*"
12+
}
913
}

0 commit comments

Comments
 (0)
0