ronaldcastillo/feedly-api

围绕 Feedly REST API 的 PHP 封装器

1.1 2014-10-14 19:30 UTC

This package is auto-updated.

Last update: 2024-09-18 10:35:48 UTC


README

注意 您可以在以下位置找到我的代码的第一版 dev

feedly-api

PHP 封装了 Feedly REST API

建设中!并非所有 API 功能都已实现。

Build Status

注释

在开始之前,请检查 示例

如果您在 Feedly API 的沙盒模式下工作,您应该知道一些事情。

  • 您的客户端 ID 和密钥必须从 这里 获取,它更新非常频繁,因此请确保定期检查。
  • 在沙盒模式下,只有 "https://" 被允许作为回调 URL。所以让它保持原样,并在需要时将其替换为您的域名,如果不同的话。您还可以在这里添加自己的允许域名 这里
  • 一旦您完成开发,您就可以联系 Feedly,并要求他们让您进入 生产

安装

将此添加到您的 composer.json 中

"require": {
        "kbariotis/feedly-api": "dev-master"
    }

或下载 ZIP

文档

构造函数

$sandbox=FALSE;
$storeAccessTokenToSession=TRUE;

$feedly = new Feedly($sandbox, $storeAccessTokenToSession);

身份验证

请参阅 示例

请注意,并非所有 Feedly 操作都需要身份验证。传递令牌是可选的。

端点

个人资料

    $profile = $feedly->getEndpoint('Profile');

    var_dump($profile->fetch());

    $profile->setOptions(array(
        'email'=>'odysseus@ithaca.gr'
    ));

    $profile->persist();

类别

    $categories = $feedly->getEndpoint('Categories');

    var_dump($categories->fetch());

    $categories->changeLabel($id, 'New Label');

    $categories->delete($id);

条目

    $entries = $feedly->getEndpoint('Entries');

    var_dump($entries->get($id));

    $streams = $feedly->getEndpoint('Streams');
    
    //Retrieve ids from stream 
    var_dump($stream->get($id,"ids"));
    
    //Retrieve contents from stream 
    var_dump($stream->get($id,"contents"));

标记

    $markers = $feedly->getEndpoint('Markers');

    var_dump($markers->get($id));

    var_dump($markers->getUnreadCount());

    $markers->markArticleAsRead(array(
        'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_14499073085:c034:d32dab1f',
        'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_1449255d60a:22c3491:9c6d71ab'
    ));

    $markers->markArticleAsUnread(array(
        'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_14499073085:c034:d32dab1f',
        'TSxGHgRh4oAiHxRU9TgPrpYvYVBPjipkmUVSHGYCTY0=_1449255d60a:22c3491:9c6d71ab'
    ));

    $markers->markFeedAsUnread(array(
        'feed/http://feeds.feedburner.com/design-milk'
    ));

    $markers->markFeedAsUnread(array(
        'user/c805fcbf-3acf-4302-a97e-d82f9d7c897f/category/design',
        'user/c805fcbf-3acf-4302-a97e-d82f9d7c897f/category/photography'
    ));

贡献

  • 创建分支
  • 在此处添加您的模型 这里
  • 使用 phpunit 运行测试
  • 发起拉取请求

许可证

The MIT License (MIT)

Copyright (c) 2014 Konstantinos Bariotis

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.