Page 1 of 1

Generating atom feed from command line?

Posted: 27 Mar 2013, 22:21
by dlc
Is there a way to generate an atom feed of articles (similar to public.php?op=rss) from the command line?

Re: Generating atom feed from command line?

Posted: 27 Mar 2013, 22:38
by fox
View source.

Re: Generating atom feed from command line?

Posted: 27 Mar 2013, 23:15
by dlc
Thanks for the quick response. Of course reading through the code is always an option, but I didn't want to recreate something that already exists.

I built a (rough!) cli tool based on update.php and public.php:

Code: Select all

$ php genfeed.php -id $id -key $key -format $format -limit $limit -offset $offset -q $q > all-articles.$format


If there's interest, I'd be happy to post it somewhere, once I clean it up; I'm actually not yet sure how much of what I have might be unnecessary (lock files, disabling sessions, and so on) and how much is superfluous copy+pasting as I learn the API.

Re: Generating atom feed from command line?

Posted: 27 Mar 2013, 23:46
by fox
I don't think you got me correctly. I meant view source of the feed. It's Atom already. :)

Sorry for the confusion etc.

Re: Generating atom feed from command line?

Posted: 28 Mar 2013, 02:58
by dlc
Yep, I completely misunderstood. However, what I want to do is to not use the web interface for this purpose -- I want to use the database and app purely for feed normalization and fetching (with update.php --feeds), and then generate an Atom feed without running the webapp.

Re: Generating atom feed from command line?

Posted: 28 Mar 2013, 08:25
by fox
If you are using php, you can call generateSyndicatedFeed and save the output somewhere (or make something based on it, which is I assume what you did.