miniflux-legacy/examples/api_client.php

43 lines
1.1 KiB
PHP
Raw Normal View History

2013-07-28 21:44:51 +02:00
<?php
require '../vendor/JsonRPC/Client.php';
use JsonRPC\Client;
$client = new Client('http://127.0.0.1:8000/jsonrpc.php');
$client->authentication('admin', 'EF8goVO/8YUxcyt');
2013-07-28 21:44:51 +02:00
$result = $client->execute('feed.create', array('url' => 'http://bbc.co.uk/news'));
var_dump($result);
$result = $client->execute('feed.list');
print_r($result);
$feed_id = $result[0]['id'];
$result = $client->execute('feed.update', array('feed_id' => $feed_id));
var_dump($result);
$result = $client->execute('feed.info', array('feed_id' => $feed_id));
print_r($result);
$result = $client->execute('feed.delete', array('feed_id' => $feed_id));
var_dump($result);
$result = $client->execute('item.list_read');
2013-08-23 03:38:09 +02:00
print_r($result);
2013-07-28 21:44:51 +02:00
$result = $client->execute('item.list_unread', array('offset' => 5, 'limit' => 2));
print_r($result);
if (count($result)) {
$result = $client->execute('item.bookmark.create', array('item_id' => $result[0]['id']));
var_dump($result);
}
$result = $client->execute('item.bookmark.list');
print_r($result);
var_dump($client->execute('item.set_list_status', array('status' => 'read', 'items' => array('57cdb841', '8ef6744e'))));