| View previous topic :: View next topic |
| Author |
Message |
mngeoff Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005 Posts: 24
|
Posted: Sat Apr 09, 2005 3:31 am Post subject: Post to Pivot from a Desktop App |
|
|
*** 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 |
|
 |
Tenshi Platinum Sponsor


Joined: 12 Apr 2003 Posts: 1598 Location: Enschede, The Netherlands
|
Posted: Sat Apr 09, 2005 6:21 am Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
Bob (too lazy to log in) Guest

|
Posted: Sat Apr 09, 2005 9:05 am Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 ) |
|
| Back to top |
|
 |
madjo Pivot Team


Joined: 11 Sep 2002 Posts: 10450 Location: Netherlands
|
Posted: Sat Apr 09, 2005 9:18 am Post subject: Re: Post to Pivot from a Desktop App |
|
|
| 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 |
|
 |
mngeoff Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005 Posts: 24
|
Posted: Sat Apr 09, 2005 2:19 pm Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
mngeoff Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005 Posts: 24
|
Posted: Sat Apr 09, 2005 2:37 pm Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 . |
|
| Back to top |
|
 |
Bob Pivot Author


Joined: 19 Jul 2002 Posts: 3602 Location: At Home
|
Posted: Sun Apr 10, 2005 5:54 am Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
Bob Pivot Author


Joined: 19 Jul 2002 Posts: 3602 Location: At Home
|
Posted: Sun Apr 10, 2005 1:45 pm Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
Bob Pivot Author


Joined: 19 Jul 2002 Posts: 3602 Location: At Home
|
|
| Back to top |
|
 |
stefanbucher Pivot Groupie


Joined: 16 Aug 2004 Posts: 26 Location: Switzerland
|
Posted: Sun Apr 10, 2005 3:13 pm Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
mngeoff Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005 Posts: 24
|
Posted: Sun Apr 10, 2005 9:24 pm Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
Bob Pivot Author


Joined: 19 Jul 2002 Posts: 3602 Location: At Home
|
Posted: Mon Apr 11, 2005 4:14 am Post subject: Re: Post to Pivot from a Desktop App |
|
|
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.
Also, my ecto (1.6, the latest one for windows i believe), doesn't seem to have a console.  _________________ Search the Forum - Pivot Documentation - phpinfo
Also visit: Mypivot - Pivot Styles |
|
| Back to top |
|
 |
timsamoff Pivot Team


Joined: 10 Feb 2004 Posts: 1754 Location: Kansas City, MO USA
|
Posted: Mon Apr 11, 2005 9:33 am Post subject: Re: Post to Pivot from a Desktop App |
|
|
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 |
|
 |
mngeoff Sub Minion of Pivot Groupie-Ness


Joined: 22 Jan 2005 Posts: 24
|
Posted: Mon Apr 11, 2005 12:01 pm Post subject: Re: Post to Pivot from a Desktop App |
|
|
| 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 |
|
 |
timsamoff Pivot Team


Joined: 10 Feb 2004 Posts: 1754 Location: Kansas City, MO USA
|
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|