Page 1 of 1

[Fixed] Bash Script to un-publish articles

Posted: 20 May 2012, 18:59
by markwaters
I use calibre ( http://calibre-ebook.com/ ) , a simple recipe and crontab to create a daily 'reading list' ebook for my kindle3.
The recipe uses the TinyTinyRSS published articles RSS feed which then gets emailed to the device.
This solution works well except that the calibre recipe blindly picks up the last two days worth of articles.
I would like to be able to un-publish the articles in TinyTinyRSS using the API so that they won't get picked up again once processed.
Hoping that makes sense , any help would be appreciated.
Thanks

Re: [Help] Bash Script to un-publish articles

Posted: 21 May 2012, 02:33
by gmargo
Are you looking for a shell script to un-publish one specific article? Or "all published articles"?

I played with the api a little, and it should be simple enough to un-publish a specific article with the "updateArticle" method.
The later might be more difficult (I don't see that "all published articles" is available though the api.)

You mentioned "shell script", so are you really looking for a straight bourne shell script, or will a php or perl script do?

Re: [Help] Bash Script to un-publish articles

Posted: 21 May 2012, 20:54
by gmargo
I've got a working Perl script that will unpublish articles through the API.

Nothing extra needed in the API since the "getHeadlines" method can return the published entries.

I just want to do a little more testing before I post it. I'm having trouble marking articles as "published".

Re: [Help] Bash Script to un-publish articles

Posted: 21 May 2012, 23:21
by markwaters
I was thinking of a bash script as thats what I am most familiar with but would be grateful for anything , perhaps this will give me the encouragement to learn a little Perl.
I only need it to unpublish all articles as I would like them all cleared down each daily run of calibre.
For history , sharing and searching I post all the links to a status.net microblog.
When you want another tester just say.
Thanks for sorting this out.

Re: [Help] Bash Script to un-publish articles

Posted: 21 May 2012, 23:48
by fox
gmargo wrote:I just want to do a little more testing before I post it. I'm having trouble marking articles as "published".


This should be straightforward.

https://github.com/gothfox/Tiny-Tiny-RS ... .java#L218

Re: [Help] Bash Script to un-publish articles

Posted: 22 May 2012, 00:36
by gmargo
Thanks. I had the unpublishing down, thanks to your wiki and the corresponding source code. My real problem was in generating test cases. From the web interface, the 'S' key toggles the 'published' flag. But there is no visual feedback (at least on the combined-display-mode) so after hitting 'S' several times, the published list never seemed quite right, at least until a feed reset. Hence confusion.

Anyway, attached here is my first version of a Perl script to unpublish articles via the API.

I'd be honored if you'd consider including it in the utils/ directory, as an example of API access from Perl.

Re: [Help] Bash Script to un-publish articles

Posted: 22 May 2012, 08:15
by fox
I did something which was long overdue and created a "contrib" repo at github for all the submitted third party stuff, including plugins. Added your file in there too, thanks!

https://github.com/gothfox/tt-rss-contrib

Re: [Help] Bash Script to un-publish articles

Posted: 03 Jun 2012, 19:34
by markwaters
Thanks guys , this is working a treat.