An open API service indexing awesome lists of open source software.

https://github.com/augustohp/reading-dump

💩 Read while taking a dump. Tags articles on GetPocket that take 5min or less to read.
https://github.com/augustohp/reading-dump

php pocket-api reading

Last synced: about 1 year ago
JSON representation

💩 Read while taking a dump. Tags articles on GetPocket that take 5min or less to read.

Awesome Lists containing this project

README

          

# Reading dump - Spend 5 minutes reading something

You've added **a lot** of articles into [Pocket][] and forgot to read
them? Well, we tag articles that are 5 minutes long so you read
them while taking your next dump.

## Quick start

This is bad, but it should work. First you need this requirements:

1. [PHP][] 5.4.0 or greater (`php` as the command will be inferred from now on).
1. [Composer][] installed (`composer.phar` as the command will be inferred from now on).
1. [Git][] installed (`git` will be inferred).

```
$ git clone git@github.com:augustohp/reading-dump.git
$ cd reading-dump
$ composer.phar install
$ export POCKET_APP_CONSUMER_KEY="68036-0687e76e71d1c40d0fa1cca5"
$ php -S 127.0.0.1:8080 -t www/
```

You should now be able to create an access token [opening this page][1]
in your browser. Make sure you `export` your access token in the
terminal you are going to use. The mechanics are separated into
different commands so it is easier to refactor them into reusable
components in the future - or just because I've not put any thoughts
whatsoever into making them:

1. Display a list of unread articles, one per line, displaying `item-id`, `since` and `word count`.
1. Filter articles that are 5 minute long from the list.
1. Tag articles by their `article-id` as `reading-dump`.

This looks like something like this, you can cron that:

```
$ export POCKET_APP_ACCESS_TOKEN="the token generated by previous page"
$ php reading-dump.php pocket-retrieve --limit 10 --since 1497812212 | \
php reading-dump.php filter-reading-time --less-than-min 5 |
php reading-dump.php pocket-tag --tag "reading-dump"
```

## TO DO

A list of ideas that might be interesting:

* [ ] Make comments accept streams and direct arguments at the same time.
* [ ] Retrieve the access token through console (no web page on our end needed).
* [ ] Maintain a `$HOME/.reading-dump.ini` file with *access token* and other useful states.
* [ ] Implement a *pager* so `limit` and `offset` can be inferred.
* [ ] Offer a single [command][2] `reading-dump.phar cron-daily`.
* [ ] Make it beautiful (E.g: allow different sources and outputs, send to kindle).

[1]: http://127.0.0.1:8080
[2]: https://github.com/box-project/box2 "Phar creation utility"
[Pocket]: https://getpocket.com
[Composer]: https://getcomposer.org
[PHP]: https://php.net
[Git]: https://git-scm.com