Example #1
0
 /**
  * @param $hashtag
  * @return Post[]
  * @throws \Exception
  */
 public function getByHash($hashtag)
 {
     $this->client->setGetfield('?q=#' . $hashtag);
     $this->client->buildOauth(self::URL, self::METHOD);
     $response = json_decode($this->client->performRequest(true, array(CURLOPT_SSL_VERIFYPEER => false)));
     return $this->formatter->format($response);
 }
Example #2
0
 public static function getStatusJan()
 {
     $settings = array('oauth_access_token' => "306688699-IwkZ3SzMCb7L76zRQIwAI4a7HWFz8qj6Wq0IZDWA", 'oauth_access_token_secret' => "mFFGk3neC1Vcd53zDIojbk6I4bQl2I2S7NsrbC9qrFcbB", 'consumer_key' => "9w36Arnf4aneDGobWr8pqZ5oe", 'consumer_secret' => "QQ6ZwaTFZpDsTgvRrcgIbV8R2hGiu0MmfoEjDArYUIuB79holt");
     $url = 'https://api.twitter.com/1.1/users/show.json';
     $getfield = '?screen_name=jwaaaap';
     $requestMethod = 'GET';
     $twitter = new \TwitterApiExchange($settings);
     $data = $twitter->setGetField($getfield)->buildOauth($url, $requestMethod)->performRequest();
     $data = json_decode($data);
     //var_dump($data);
     return $data;
 }
Example #3
0
 /**
  * TWITTER hämta tweets 
  * http://stackoverflow.com/questions/12916539/simplest-php-example-for-retrieving-user-timeline-with-twitter-api-version-1-1
  * https://github.com/J7mbo/twitter-api-php
  */
 public function getTweets($numberOfTweets = 0)
 {
     $ret = array();
     $url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
     $getfield = '?screen_name=al223ec';
     $requestMethod = 'GET';
     $twitter = new TwitterApiExchange($this->twitterSettings);
     $decode = json_decode($twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest(), true);
     if ($decode) {
         $index = 1;
         foreach ($decode as $key => $value) {
             if ($value['user'] && $value['text']) {
                 $ret[] = new Tweet($value['user']['name'], $value['text'], $value['user']['screen_name']);
             }
             $index += 1;
             if ($numberOfTweets !== 0 && $index > $numberOfTweets) {
                 break;
             }
         }
     }
     return $ret;
 }
Example #4
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', 'PagesController@index');
//Route::get('/index', 'PagesController@index');
Route::get('/contact', 'PagesController@contact');
Route::get('/overview_games', 'PagesController@overview_games');
Route::get('/info_game', 'PagesController@info_game');
Route::get('/test', 'PagesController@test');
// test routes
Route::get('/twittertest', function () {
    $settings = array('oauth_access_token' => "306688699-IwkZ3SzMCb7L76zRQIwAI4a7HWFz8qj6Wq0IZDWA", 'oauth_access_token_secret' => "mFFGk3neC1Vcd53zDIojbk6I4bQl2I2S7NsrbC9qrFcbB", 'consumer_key' => "9w36Arnf4aneDGobWr8pqZ5oe", 'consumer_secret' => "QQ6ZwaTFZpDsTgvRrcgIbV8R2hGiu0MmfoEjDArYUIuB79holt");
    $url = 'https://api.twitter.com/1.1/users/show.json';
    $getfield = '?screen_name=vlambeer';
    $requestMethod = 'GET';
    $twitter = new TwitterApiExchange($settings);
    $data = $twitter->setGetField($getfield)->buildOauth($url, $requestMethod)->performRequest();
    $data = json_decode($data);
    var_dump($data);
    die;
    //    echo $data->location;
});