Page 1 of 1

Post from external Skript

Posted: Thu Sep 01, 2005 7:19 pm
by neueruser
Hello,

I want to post articles to s9y from an external script, but
also want to use the plugins (like google sitemap and rss ping).

Is this somehow possible?


Regards, neueruser.

ps. sorry for x posting (german-forum)

Re: Post from external Skript

Posted: Thu Sep 01, 2005 8:57 pm
by garvinhicking
If you use the Serendipity API functions, then this is no problem as the google sitemap plugin is called as well.

How does your script look like? Just call it something like this:

Code: Select all

<?php
chdir('/path/to/s9y');
include 'serendipity_config.inc.php';
$entry = array(
'title' => 'Test',
'body' => 'Test'
);
serendipity_updertEntry($entry);
?>
This inserts an entry and also updates the sitemap.gz.

HTH and Regards,
Garvin

API-Documentation?

Posted: Mon Sep 12, 2005 6:15 pm
by pdaether
Hi,

at the moment i have got the same problem.
The code above inserts the new entry as draft.
How can i publish this entry and how can i check login/password with the Serendipity API functions?
Is there a documentation for this functions?
On s9y i only found a documentation about the Plugin API.

Regards,
Patrick

Re: API-Documentation?

Posted: Mon Sep 12, 2005 6:37 pm
by garvinhicking
Sadly this functionality has not yet been documented, thus you'll need to learn it by looking at the function.

You must set a "isdraft" => false attribute in your array to publish non-drafts.

Look at the mail2s9y additional plugin or the popfetcher plugin, both use the serendipity_updertEntry function to make new posts and both set appropriate things.

If you want to do full user authentication it is suggested you use XML-RPC blogger/MT API instead, which is implemented by s9y if you use the XMLRPC posting plugin.

Regards,
Garvin

Posted: Mon Sep 12, 2005 7:15 pm
by pdaether
Thanks for the fast answer.
Setting isdraft to false has got no effect because serendipity_updertEntry() checks the publishrights. So i need user authentication.
I will have a look at the popfetcher plugin - i think then everything becomes clear.

Regards,
Patrick