fxneumann / oneclickpocket

Pocket plugin for Tiny Tiny RSS
38 stars 9 forks source link

Ability to add a tag #5

Open screendriver opened 10 years ago

screendriver commented 10 years ago

Would it be possible to add a tag to a saved article? At the moment it saves the article to pocket but without any tags.

Bas1c commented 10 years ago

The Pocket API supports adding a tag to a new entry. Should it be always the same tag, only to let Pocket know that it is an entry from ttrss, or should it be (a) tag(s) used in ttrss you want to copy to Pocket?

screendriver commented 10 years ago

Good question! :flushed: I would be thankful for any solution :grin:

fxneumann commented 10 years ago

Depending on what you want it's quite easy: just add an item »tags« to the array $postfields in line 71ff of init.php:

$postfields = array(
                         'consumer_key' => $consumer_key,
                         'access_token' => $pocket_access_token,
                        'url'          => $article_link,
                        'title'        => $title,
                        'tags'      => $tags
                        );

For $tags you can insert a string constant, e.g "added-by-ttrs" or anything you want, e.g. the tags of the article in TTRS (I have to check how to retrieve them). The tags are comma separated.

I see the use case for both; it would be possible to have two check boxes in the options dialogue, »Add article tags« and »Add ›added by TTRS‹ tag«. Is something like this what you have in mind?

If you want to enter the tags manually with every article added I'd propose to write a new plugin; the purpose I see in this plugin is to add with the minimum possible interaction, hence »oneclickpocket«.

screendriver commented 10 years ago

I added 'tags' to the array in init.php and it works perfectly! :+1: Thanks for your support and the detailed instructions!

Your idea with the two chechboxes would be nice so that no one have to edit the source files. Manually entering tags is not necessary (in my case). In pocket I created a tag "news" for every news article that I found on the web (via Tiny Tiny RSS, Twitter and so on). Therefore I asked for a tag feature in oneclickpocket :wink: