.weblog engine
FAQ :: Search ::  Memberlist ::  Register :: Profile ::  Usergroups ::  Log in
Log in to check your private messages ::  Download Pivot :: Support Pivot | Info
Watch any topic and be notified by email when anyone makes a post! Click on Watch this topic for replies.
Post to Pivot from a Desktop App
Goto page 1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> Extension Discussion & Development
View previous topic :: View next topic  
Author Message
mngeoff
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005
Posts: 24

PostPosted: Sat Apr 09, 2005 3:31 am    Post subject: Post to Pivot from a Desktop App Reply with quote

*** MetaWeblog support is now part of the default Pivot installation - read more in the docs. ***

Here is a preliminary PHP script that lets you post to pivot from metaWeblog-compatible applications (I use ecto, but there are several others).

If you want to try it out, download the script from http://www.rocksandpaper.com/metaweblog.zip, then drop the metaweblog.php file in your /pivot folder.

Once you've done that, you can point your blogging app at the new file (with a category name as your "Blog ID") and post away. It also works with Flickr's blogging system.

This file is modified from myPhpBlog's api.php, so it's GPL-licensed.

Let me know if it works (or doesn't work) for you...

Edited by hansfn - added top text (in bold/centered).
Back to top
View user's profile Send private message
Tenshi
Platinum Sponsor
<b>Platinum Sponsor</b>


Joined: 12 Apr 2003
Posts: 1598
Location: Enschede, The Netherlands

PostPosted: Sat Apr 09, 2005 6:21 am    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I tried your script with Flickr's blogging functionality and it seems to work great! Except for one small thing... my frontpage isn't rebuild, after the entry is posted.
The entry shows up okay in the entries overview.

It seems the frontpage is actually rebuild but too early, just before the entry is added to the db. Cause when I do another post from Flickr, the previous entry does show up on the frontpage, but the new one does not.

_________________
bramn - When just a first name is not enough!
Back to top
View user's profile Send private message MSN Messenger
Bob (too lazy to log in)
Guest





PostPosted: Sat Apr 09, 2005 9:05 am    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

Making pivot rebuild the frontpage isn't too hard.. I'm at my parents'house right now, so i don't have easy access to the code, but if you want to know how to make it rebuild, lit should be sufficient to call

buildfrontpage_function();

(if it doesn't work that easily, i'll take a closer look Smile )
Back to top
madjo
Pivot Team
<b>Pivot Team</b> <!-- Moderator -->


Joined: 11 Sep 2002
Posts: 10450
Location: Netherlands

PostPosted: Sat Apr 09, 2005 9:18 am    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

Tenshi wrote:
I tried your script with Flickr's blogging functionality and it seems to work great! Except for one small thing... my frontpage isn't rebuild, after the entry is posted.
The entry shows up okay in the entries overview.

It seems the frontpage is actually rebuild but too early, just before the entry is added to the db. Cause when I do another post from Flickr, the previous entry does show up on the frontpage, but the new one does not.
it might be that this is a bug in pivot, because I have to rebuild the frontpage after I created a new post, otherwise it would not turn up on the frontpage...
_________________
Forum search / Pivot Manual / Also visit MyPivot.net
Firefox pivot search
How to sponsor us
Click here for Dutch support
Back to top
View user's profile Send private message Send e-mail MSN Messenger
mngeoff
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005
Posts: 24

PostPosted: Sat Apr 09, 2005 2:19 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I'll have to try Bob's suggestion. Right now it uses this to rebuild (which I'm sure I copied from somewhere in the Pivot code):

Code:
$overview_arr = $db->getlist(-4,0,"","", FALSE);
$VerboseGenerate = FALSE;
foreach ($overview_arr as $entry) {
generate_pages($entry['code'], TRUE, TRUE, TRUE, FALSE);
}


I'll try Bob's buildfrontpage_function() and see if that works better. (Although I haven't personally had this problem)
Back to top
View user's profile Send private message
mngeoff
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005
Posts: 24

PostPosted: Sat Apr 09, 2005 2:37 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

buildfrontpage_function() does rebuild the front page properly, but it breaks the XML response.

It writes this to the beginning of the output:

Code:
Response:
Write: ../archives/archive_2005-w14.php<br />
Write: ../index.php<br />
Write: ../rss.xml<br />
Write: ../atom.xml<br />
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>


It actually DOES rebuild the page properly, but Flickr (or other app) will always say it failed Smile.
Back to top
View user's profile Send private message
Bob
Pivot Author
<b>Pivot Author</b>


Joined: 19 Jul 2002
Posts: 3602
Location: At Home

PostPosted: Sun Apr 10, 2005 5:54 am    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

buildfrontpage_function() probably writes output to the 'browser', which you do not want.

It's not the tidiest way to do it, but you can solve this by wrapping it like this:

Code:

ob_start();
buildfrontpage_function();
ob_end_clean();

_________________
Search the Forum - Pivot Documentation - phpinfo
Also visit: Mypivot - Pivot Styles
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob
Pivot Author
<b>Pivot Author</b>


Joined: 19 Jul 2002
Posts: 3602
Location: At Home

PostPosted: Sun Apr 10, 2005 1:45 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I've been testing a bit with w.bloggar to see how it works, and posting works fine, but it complains when i try to get a list of the latest posts..

Could this be an issue with w.bloggar, or of me setting it up incorrectly? (i'm using metaWeblog Api instead of blogger api.. that's correct, right?)

_________________
Search the Forum - Pivot Documentation - phpinfo
Also visit: Mypivot - Pivot Styles
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob
Pivot Author
<b>Pivot Author</b>


Joined: 19 Jul 2002
Posts: 3602
Location: At Home

PostPosted: Sun Apr 10, 2005 2:33 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I've come a bit farther.. I set it up here: http://mijnkopthee.nl/pivot/metaweblog.php. Using Ecto, one category works:

http://mijnkopthee.nl/images/ecto_ok.gif

and one doesn't:

http://mijnkopthee.nl/images/ecto_notok.gif

As ecto suggests, There's probably something wrong with the encoding of the xml response. Is there a way I could check the raw xml metaweblog.php returns?

_________________
Search the Forum - Pivot Documentation - phpinfo
Also visit: Mypivot - Pivot Styles
Back to top
View user's profile Send private message Send e-mail Visit poster's website
stefanbucher
Pivot Groupie
Pivot Groupie


Joined: 16 Aug 2004
Posts: 26
Location: Switzerland

PostPosted: Sun Apr 10, 2005 3:13 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I just came by to see what the Pivot forum will tell me about using ecto and was surprised to see this recent discussion.

I think it's great to make Pivot work with a desktop application like ecto by means of metaweblog.php.

But: Can I be sure that ecto won't do any harm to my Pivot installation and settings on my webserver?

And: Which one is the latest development of metaweblog.php now?

Thank you for the good work.

_________________
Pivot on my site: http://www.stefanbucher.net/blog
Back to top
View user's profile Send private message Visit poster's website
mngeoff
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005
Posts: 24

PostPosted: Sun Apr 10, 2005 9:24 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

Sorry for taking so long to reply. I've been away from my computer most of the weekend.

Bob:

I think Ecto has a "Console" option somewhere that will show you the XML -- maybe on the "tools" menu? I'll have to look when I get back to my own PC.

stefanbucher: metaweblog.php doesn't change any pivot settings, so it won't hurt your pivot installation. I always keep the latest version at http://www.rocksandpaper.com/metaweblog.zip

-----

The errors with the recent post listings seem to be related to problems with the UTF8 encoding. I suspect that the errors happen when it tries to get posts with certain non-english characters. Can somebody who is having trouble tell me if the new version fixes the problem?

For the problems with page-rebuilding, I'm not sure why that's happening yet. The page-rebuilding code that I'm using is actually copied directly from buildfrontpage_function(), but for some reason it isn't always "seeing" the new one. Is there some kind of delay between writing an entry and being able to read it?

[Update: OK, I think I found the problem w/ page rebuilding -- I need to be using the generate_pages($id) function (this seems to be what pivot does when you create an entry from the control panel) Should be fixed now.]
Back to top
View user's profile Send private message
Bob
Pivot Author
<b>Pivot Author</b>


Joined: 19 Jul 2002
Posts: 3602
Location: At Home

PostPosted: Mon Apr 11, 2005 4:14 am    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

Nope, this version of the metaweblog script doesn't fix it yet.

w.bloggar gives another error on almost every action i do: "The categoy functions aren't supported. Specify your category under Blog ID".

I haven't the foggiest idea what that means. Smile

Also, my ecto (1.6, the latest one for windows i believe), doesn't seem to have a console. Hmmm

_________________
Search the Forum - Pivot Documentation - phpinfo
Also visit: Mypivot - Pivot Styles
Back to top
View user's profile Send private message Send e-mail Visit poster's website
timsamoff
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 10 Feb 2004
Posts: 1754
Location: Kansas City, MO USA

PostPosted: Mon Apr 11, 2005 9:33 am    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I've installed Metaweblog.php, but I am getting an error when I try to set up my Flickr blog:
Flickr wrote:
The endpoint you entered was not correct.

I'm entering my info in the MetaWeblogAPI section, but I've also tried a couple of the other API choices.

What am I doing wrong?

Thanks!
Tim

_________________
Weblog - http://tim.samoff.com
Baby Blog - http://kc.samoff.com
Photography - http://www.flickr.com/photos/timsamoff/
Music - http://www.adkoc.com
Back to top
View user's profile Send private message
mngeoff
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005
Posts: 24

PostPosted: Mon Apr 11, 2005 12:01 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

timsamoff wrote:
I've installed Metaweblog.php, but I am getting an error when I try to set up my Flickr blog:
Flickr wrote:
The endpoint you entered was not correct.

I'm entering my info in the MetaWeblogAPI section, but I've also tried a couple of the other API choices.

What am I doing wrong?

Thanks!
Tim
What are you entering as your endpoint?
Back to top
View user's profile Send private message
timsamoff
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 10 Feb 2004
Posts: 1754
Location: Kansas City, MO USA

PostPosted: Mon Apr 11, 2005 12:17 pm    Post subject: Re: Post to Pivot from a Desktop App Reply with quote

I pointed to where I put the metaweblog file (and where the ReadMe says to):
http://www.sense-datum.org/pivot/metaweblog.php

-T.

_________________
Weblog - http://tim.samoff.com
Baby Blog - http://kc.samoff.com
Photography - http://www.flickr.com/photos/timsamoff/
Music - http://www.adkoc.com
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> Extension Discussion & Development All times are GMT - 4 Hours
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7
|
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Your generosity is appreciated!
Gambling News was the last to make a donation
:: go here for sponsorship information ::
Special thanks to our platinum sponsors: Gambling News  
DreamHost

powered by phpBB | RSS Feed