HTML-statuscodes für comments

Discussion corner for Developers of Serendipity.
Post Reply
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

HTML-statuscodes für comments

Post by schimanke »

I have built an iPhone-/iPad-App on top of my sy9-blog which takes the contents of the RSS feed and puts it into an iPhone-friendly design. I do the same with the comments-RSS. Writing comments is done through the s9y comments-form, which is presented in an iPhone-optimized webseite. So far so good...

My problem now is how to handle everything after a comment is posted. Right now the app shows the "normal" website with the indication that the comment was successfully or unsuccessfully posted, which is not very beautiful. At this point I would like to use HTML statuscodes to fire up a pop-up which tells the writer what has happened. I already do that in my app for example with Twitter. Something like this:

Code: Select all

if (statusCode == 200) {
showMessage @"Tweet successfully posted."; }

else if (statusCode == 401) {
showMessage @"Tweet could not be posted."; }

...
Is something like this possible for the comments in s9y as well? Something with the wfwComment API? How can I use it? Thanks in advance!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: HTML-statuscodes für comments

Post by garvinhicking »

Hi!

For submitting automatted comments, the "wfw:CommentAPI" was introduced, which is also supported in the s9y blog feed. Through that interface you can automattedly submit comments to your blog - have you tried that out?

I haven't used it for a long while, the API is quite old, but should still work.

Another way of course would be to patch up your entries.tpl file, where the $is_comment_added, $is_comment_moderate and $coments_messagestack items are emitted. You could emit special HTML markup like "<!--COMMENT_ADDED-->" on the page, when successful. Your app could check that HTML return code for this special markup and behave accordingly.

Another option would be to automate comment submission by using the s9y API event hooks, where you post your comments to your own plugin to index.php?/plugin/iphone_comment (the "external_event" API hook, which for example the tagging plugin uses). There you could work on your HTTP POST/GET variables, use the s9y api for serendipity_addComment() etc. and return your own status codes like the apps requires...

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/
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

Re: HTML-statuscodes für comments

Post by schimanke »

Okay, I've been playing around with option 2 and 3 over the weekend a bit but to no avail.My last hope now is the "wfw:CommentAPI". How exactly can I use it for submitting automatted comments? Are there any documents or further information about this API?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: HTML-statuscodes für comments

Post by garvinhicking »

schimanke wrote:Okay, I've been playing around with option 2 and 3 over the weekend a bit but to no avail.My last hope now is the "wfw:CommentAPI". How exactly can I use it for submitting automatted comments? Are there any documents or further information about this API?
As I mentioned, you need to google for it - it's nothing specific to s9y.

Option 2 and 3 would be the better ones I think. You should describe what you actually did and what your problems are...

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