PHP code example of warslett / tweet-sync-doctrine

1. Go to this page and download the library: Download warslett/tweet-sync-doctrine library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

warslett / tweet-sync-doctrine example snippets


#!/usr/bin/env php

# app/console

// replace with the path to your own autoloader
 'warslett_tweet_sync.consumer_key' => 'YOUR CONSUMER KEY',
    'warslett_tweet_sync.consumer_secret' => 'YOUR CONSUMER SECRET',
    'warslett_tweet_sync.oauth_access_token' => 'YOUR OAUTH ACCESS TOKEN',
    'warslett_tweet_sync.oauth_access_token_secret' => 'YOUR OAUTH ACCESS TOKEN SECRET',
    'database.config' => [
        // Replace with your own db params
        // See: http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/configuration.html
        'driver'   => 'pdo_sqlite',
        'path'     => __DIR__ . "/db.sqlite"
    ]
])->run();



// replace with the path to your own autoloader
pository('WArslett\TweetSync\Model\Tweet');

//Not in smyfony
$persistenceService = \WArslett\TweetSyncDoctrine\ORM\Doctrine\TweetPersistenceService::create([
    // Replace with your own db params
    // See: http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/configuration.html
    'driver'   => 'pdo_sqlite',
    'path'     => __DIR__ . "/db.sqlite"
]);
$tweetRepository = $persistenceService->getTweetRepository();

$tweets = $tweetRepository->findByUsername('BBCBreaking');

foreach($tweets as $tweet) {
    print($tweet->getText());
}