Generating atom feed from command line?

Development-related discussion, including bundled plugins
dlc
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 27 Mar 2013, 22:19

Generating atom feed from command line?

Postby dlc » 27 Mar 2013, 22:21

Is there a way to generate an atom feed of articles (similar to public.php?op=rss) from the command line?

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

Re: Generating atom feed from command line?

Postby fox » 27 Mar 2013, 22:38

View source.

dlc
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 27 Mar 2013, 22:19

Re: Generating atom feed from command line?

Postby dlc » 27 Mar 2013, 23:15

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.

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

Re: Generating atom feed from command line?

Postby fox » 27 Mar 2013, 23:46

I don't think you got me correctly. I meant view source of the feed. It's Atom already. :)

Sorry for the confusion etc.

dlc
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 27 Mar 2013, 22:19

Re: Generating atom feed from command line?

Postby dlc » 28 Mar 2013, 02:58

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.

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

Re: Generating atom feed from command line?

Postby fox » 28 Mar 2013, 08:25

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.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests