Skip to content

Commit d2cf94e

Browse files
committed
Syntax highlighting for the code in README.md
1 parent 0672d1e commit d2cf94e

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

README.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,41 @@ Usage
1313

1414
[Create a twitter application](https://dev.twitter.com/apps) then
1515

16-
<?php
16+
```php
17+
<?php
1718

18-
require __DIR__.'/vendor/autoload.php';
19+
require __DIR__.'/vendor/autoload.php';
1920

20-
use Lyrixx\Twitter\Twitter;
21+
use Lyrixx\Twitter\Twitter;
2122

22-
// You can find them at: https://dev.twitter.com/apps > your app
23-
$consumerKey = 'xvz1evFS4wEEPTGEFPHBog';
24-
$accessToken = '370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb';
25-
$consumerSecret = 'kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw';
26-
$accessTokenSecret = 'LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE';
23+
// You can find them at: https://dev.twitter.com/apps > your app
24+
$consumerKey = 'xvz1evFS4wEEPTGEFPHBog';
25+
$accessToken = '370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb';
26+
$consumerSecret = 'kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw';
27+
$accessTokenSecret = 'LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE';
2728

28-
$twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
29+
$twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
2930

30-
// Fetch yours last tweets
31-
$response = $twitter->query('GET', 'statuses/user_timeline');
32-
$tweets = json_decode($response->getBody(), true);
31+
// Fetch yours last tweets
32+
$response = $twitter->query('GET', 'statuses/user_timeline');
33+
$tweets = json_decode($response->getBody(), true);
3334

34-
// Search some tweets
35-
$response = $twitter->query('GET', 'search/tweets', array('q' => '#symfony2'));
36-
$tweets = json_decode($response->getBody(), true);
35+
// Search some tweets
36+
$response = $twitter->query('GET', 'search/tweets', array('q' => '#symfony2'));
37+
$tweets = json_decode($response->getBody(), true);
3738

38-
// Tweet
39-
// Works only if your application has read/write scope
40-
try {
41-
$response = $twitter->query('POST', 'statuses/update');
42-
} catch (Lyrixx\Twitter\Exception\ApiClientException $e) {
43-
$response = $e->getResponse();
44-
$errors = json_decode($response->getBody(), true); // {"errors":[{"code":170,"message":"Missing required parameter: status"}]}
45-
}
39+
// Tweet
40+
// Works only if your application has read/write scope
41+
try {
42+
$response = $twitter->query('POST', 'statuses/update');
43+
} catch (Lyrixx\Twitter\Exception\ApiClientException $e) {
44+
$response = $e->getResponse();
45+
$errors = json_decode($response->getBody(), true); // {"errors":[{"code":170,"message":"Missing required parameter: status"}]}
46+
}
4647

47-
// No exception are throwed, it just works
48-
$response = $twitter->query('POST', 'statuses/update', array('status' => 'Playing with twitter API'));
48+
// No exception are throwed, it just works
49+
$response = $twitter->query('POST', 'statuses/update', array('status' => 'Playing with twitter API'));
50+
```
4951

5052
License
5153
-------

0 commit comments

Comments
 (0)