[Fixed] Bash Script to un-publish articles

Request new functionality here
User avatar
markwaters
Bear Rating Trainee
Bear Rating Trainee
Posts: 32
Joined: 20 May 2008, 13:10
Location: France
Contact:

[Fixed] Bash Script to un-publish articles

Postby markwaters » 20 May 2012, 18:59

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
Last edited by markwaters on 03 Jun 2012, 19:35, edited 1 time in total.

User avatar
gmargo
Bear Rating Disaster
Bear Rating Disaster
Posts: 62
Joined: 08 Jan 2012, 22:33
Location: Silicon Valley

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

Postby gmargo » 21 May 2012, 02:33

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?

User avatar
gmargo
Bear Rating Disaster
Bear Rating Disaster
Posts: 62
Joined: 08 Jan 2012, 22:33
Location: Silicon Valley

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

Postby gmargo » 21 May 2012, 20:54

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".

User avatar
markwaters
Bear Rating Trainee
Bear Rating Trainee
Posts: 32
Joined: 20 May 2008, 13:10
Location: France
Contact:

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

Postby markwaters » 21 May 2012, 23:21

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.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

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

Postby fox » 21 May 2012, 23:48

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

User avatar
gmargo
Bear Rating Disaster
Bear Rating Disaster
Posts: 62
Joined: 08 Jan 2012, 22:33
Location: Silicon Valley

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

Postby gmargo » 22 May 2012, 00:36

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.
Attachments
unmark_published.pl.gz
Unmark published files with Perl through API. Demos API.
(2.24 KiB) Downloaded 133 times

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

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

Postby fox » 22 May 2012, 08:15

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

User avatar
markwaters
Bear Rating Trainee
Bear Rating Trainee
Posts: 32
Joined: 20 May 2008, 13:10
Location: France
Contact:

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

Postby markwaters » 03 Jun 2012, 19:34

Thanks guys , this is working a treat.


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 4 guests