8000 Add quote tweet sample to Readme, see #154 · olayakout/codebird-php@95eeea0 · GitHub
[go: up one dir, main page]

Skip to content
65F5

Commit 95eeea0

Browse files
committed
Add quote tweet sample to Readme, see jublo#154
1 parent b5e066f commit 95eeea0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,3 +847,30 @@ use the corresponding [`CURLPROXY_*` constants](http://php.net/curl_setopt), lik
847847
```php
848848
$cb->setProxy('<host>', '<port>', CURLPROXY_SOCKS5);
849849
```
850+
851+
### …quote a Tweet?
852+
853+
Quoting a Tweet is different from a Retweet because you may add your own text.
854+
The original Tweet will appear below your quote.
855+
To quote a Tweet, add a link to the original Tweet to your quote, like in this sample:
856+
857+
```php
858+
$original_tweet = [
859+
'id_str' => '684483801687392256',
860+
'user' => [
861+
'screen_name' => 'LarryMcTweet'
862+
]
863+
];
864+
$original_tweet = (object) $original_tweet; // sample, get real Tweet from API
865+
866+
$id = $original_tweet->id_str; // use the `id_str` field because of long numbers
867+
$screen_name = $original_tweet->user->screen_name;
868+
869+
// looks like this: https://twitter.com/LarryMcTweet/status/684483801687392256
870+
$url = "https://twitter.com/$screen_name/status/$id";
871+
$text = 'I’d like to quote a tweet.'; // maximum length = 140 minus 24 (link length) minus 1 space
872+
873+
$reply = $cb->statuses_update([
874+
'status' => "$text $url"
875+
]);
876+
```

0 commit comments

Comments
 (0)
0