PHP code example of kaicmueller / medium

1. Go to this page and download the library: Download kaicmueller/medium 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/ */

    

kaicmueller / medium example snippets



$medium = new \KaiCMueller\Medium\Medium(
    [
        'user' => '@yourUsername',
        'cacheTime' => 600, // an optional cache lifetime
        'useFileCache' => false, // de-/activate the optional build in file cache
        'fileCachePath' => '/path/to/cacheFile' // optional file path for internal file cache
    ],
    $cache // optional parameter to inject own cache class implementing \KaiCMueller\Medium\Cache\CacheInterface
);

foreach ($medium->getPosts() as $post) {
    echo $post->getTitle();
}



bash
# Install Composer
curl -sS https://getcomposer.org/installer | php