Post from external Skript

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
neueruser

Post from external Skript

Post 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)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Post from external Skript

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pdaether
Posts: 4
Joined: Mon Sep 12, 2005 5:59 pm
Location: Germany
Contact:

API-Documentation?

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: API-Documentation?

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pdaether
Posts: 4
Joined: Mon Sep 12, 2005 5:59 pm
Location: Germany
Contact:

Post 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
Post Reply