@@ -17,8 +17,8 @@ GNU General Public License for more details.
17
17
You should have received a copy of the GNU General Public License
18
18
along with this program. If not, see < http://www.gnu.org/licenses/ > .
19
19
20
- [ ![ Coverage Status] ( https://img.shields.io/coveralls/jublonet/codebird-php/master .svg )] ( https://coveralls.io/github/jublonet/codebird-php?branch=master )
21
- [ ![ Travis Status] ( https://img.shields.io/travis/jublonet/codebird-php/master .svg )] ( https://travis-ci.org/jublonet/codebird-php/branches )
20
+ [ ![ Coverage Status] ( https://img.shields.io/coveralls/jublonet/codebird-php/develop .svg )] ( https://coveralls.io/github/jublonet/codebird-php?branch=develop )
21
+ [ ![ Travis Status] ( https://img.shields.io/travis/jublonet/codebird-php/develop .svg )] ( https://travis-ci.org/jublonet/codebird-php/branches )
22
22
23
23
### Requirements
24
24
@@ -168,11 +168,11 @@ print_r($reply);
168
168
Tweeting is as easy as this:
169
169
170
170
``` php
171
- $reply = $cb->statuses_update('status=Whohoo, I just tweeted !');
171
+ $reply = $cb->statuses_update('status=Whohoo, I just Tweeted !');
172
172
```
173
173
174
174
:warning : * Make sure to urlencode any parameter values that contain
175
- query-reserved characters, like tweeting the ` & ` sign:*
175
+ query-reserved characters, like Tweeting the ` & ` sign:*
176
176
177
177
``` php
178
178
$reply = $cb->statuses_update('status=' . urlencode('Fish & chips'));
@@ -205,7 +205,7 @@ $params = [
205
205
];
206
206
$reply = $cb->users_show($params);
207
207
```
208
- This is the [ resulting tweet ] ( https://twitter.com/LarryMcTweet/status/482239971399835648 )
208
+ This is the [ resulting Tweet ] ( https://twitter.com/LarryMcTweet/status/482239971399835648 )
209
209
sent with the code above.
210
210
211
211
### Requests with app-only auth
@@ -314,16 +314,15 @@ to ```statuses/update```, like this:
314
314
// convert media ids to string list
315
315
$media_ids = implode(',', $media_ids);
316
316
317
- // send tweet with these medias
317
+ // send Tweet with these medias
318
318
$reply = $cb->statuses_update([
319
319
'status' => 'These are some of my relatives.',
320
320
'media_ids' => $media_ids
321
321
]);
322
322
print_r($reply);
323
- );
324
323
```
325
324
326
- Here is a [ sample tweet ] ( https://twitter.com/LarryMcTweet/status/475276535386365952 )
325
+ Here is a [ sample Tweet ] ( https://twitter.com/LarryMcTweet/status/475276535386365952 )
327
326
sent with the code above.
328
327
329
328
More [ documentation for uploading media] ( https://dev.twitter.com/rest/public/uploading-media ) is available on the Twitter Developer site.
@@ -353,8 +352,8 @@ You need to perform at least 3 calls to obtain your `media_id` for the video:
353
352
354
353
1 . Send an ` INIT ` event to get a ` media_id ` draft.
355
354
2 . Upload your chunks with ` APPEND ` events, each one up to 5MB in size.
356
- 3 . Send a ` FINALIZE ` event to convert the draft to a ready-to-tweet ` media_id ` .
357
- 4 . Post your tweet with video attached.
355
+ 3 . Send a ` FINALIZE ` event to convert the draft to a ready-to-Tweet ` media_id ` .
356
+ 4 . Post your Tweet with video attached.
358
357
359
358
Here’s a sample for video uploads:
360
359
@@ -405,7 +404,7 @@ if ($reply->httpstatus < 200 || $reply->httpstatus > 299) {
405
404
die();
406
405
}
407
406
408
- // Now use the media_id in a tweet
407
+ // Now use the media_id in a Tweet
409
408
$reply = $cb->statuses_update([
410
409
'status' => 'Twitter now accepts video uploads.',
411
410
'media_ids' => $media_id
@@ -496,7 +495,7 @@ and will always send the correct Content-Type automatically.
496
495
497
496
Find out more about the [ Collections API] ( https://dev.twitter.com/rest/collections/about ) in the Twitter API docs.
498
497
499
- Here’s a sample for adding a tweet using that API method:
498
+ Here’s a sample for adding a Tweet using that API method:
500
499
501
500
``` php
502
501
$reply = $cb->collections_entries_curate([
@@ -706,7 +705,7 @@ stdClass Object
706
705
)
707
706
```
708
707
709
- If you need to get more details, such as the user’s latest tweet ,
708
+ If you need to get more details, such as the user’s latest Tweet ,
710
709
you should fetch the complete User Entity. The simplest way to get the
711
710
user entity of the currently authenticated user is to use the
712
711
``` account/verify_credentials ``` API method. In Codebird, it works like this:
@@ -840,3 +839,37 @@ You may also use an authenticated proxy. Use the following call:
840
839
$cb->setProxy('<host >', '<port >');
841
840
$cb->setProxyAuthentication('<username >:<password >');
842
841
```
842
+
843
+ By default, a HTTP proxy is assumed. To use a different proxy type,
844
+ use the corresponding [ ` CURLPROXY_* ` constants] ( http://php.net/curl_setopt ) , like this:
845
+
846
+ ``` php
847
+ $cb->setProxy('<host >', '<port >', CURLPROXY_SOCKS5);
848
+ ```
849
+
850
+ ### …quote a Tweet?
851
+
852
+ Quoting a Tweet is different from a Retweet because you may add your own text.
853
+ The original Tweet will appear below your quote.
854
+ To quote a Tweet, add a link to the original Tweet to your quote, like in this sample:
855
+
856
+ ``` php
857
+ $original_tweet = [
858
+ 'id_str' => '684483801687392256',
859
+ 'user' => [
860
+ 'screen_name' => 'LarryMcTweet'
861
+ ]
862
+ ];
863
+ $original_tweet = (object) $original_tweet; // sample, get real Tweet from API
864
+
865
+ $id = $original_tweet->id_str; // use the `id_str` field because of long numbers
866
+ $screen_name = $original_tweet->user->screen_name;
867
+
868
+ // looks like this: https://twitter.com/LarryMcTweet/status/684483801687392256
869
+ $url = "https://twitter.com/$screen_name/status/$id";
870
+ $text = 'I’d like to quote a Tweet.'; // maximum length = 140 minus 24 (link length) minus 1 space
871
+
872
+ $reply = $cb->statuses_update([
873
+ 'status' => "$text $url"
874
+ ]);
875
+ ```
0 commit comments