kaicmueller/medium
Composer 安装命令:
composer require kaicmueller/medium
包简介
A PHP library for reading the latest posts from a Medium.com feed
关键字:
README 文档
README
A PHP library for reading the latest posts from a Medium.com feed
I built this library for showing my latest Medium posts on my web profile. As this might be interesting to others, I provide it to the public. This library is currently under development and has a limited feature set. Feel free to contact me for any bugs or contributions.
Current features:
- Get up to ten latest Medium posts with title, preview text, url, date and tags
- Built in file cache and possibility to inject own cache
Usage
$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(); }
Install
The recommended way to install is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
In your composer.json file add the following requirement
"require": { "kaicmueller/medium": "~1.0" }
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
You can then later update using composer:
composer.phar update
Versions
- 2.0.0 - Post date now is DateTime object
- 1.0.1 - Adjusting Readme for correct versioning
- 1.0.0 - First release version
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-05