| 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. |
| Code: |
| $overview_arr = $db->getlist(-4,0,"","", FALSE);
$VerboseGenerate = FALSE; foreach ($overview_arr as $entry) { generate_pages($entry['code'], TRUE, TRUE, TRUE, FALSE); } |
| 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> |
| Code: |
|
ob_start(); buildfrontpage_function(); ob_end_clean(); |
| Flickr wrote: |
| The endpoint you entered was not correct. |
| timsamoff wrote: | ||
I've installed Metaweblog.php, but I am getting an error when I try to set up my Flickr blog:
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 |
| timsamoff wrote: |
| I pointed to where I put the metaweblog file (and where the ReadMe says to):
http://www.sense-datum.org/pivot/metaweblog.php -T. |
| Bob wrote: |
| 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. ![]() |
| Quote: |
| I've been testing with the logfile open, and as far as i can tell, it doesn't return _faulty_ xml, it just doesn't return _anything_. No new entry in the logfile, at least. |
| Bakkel wrote: |
| For the record!!
I've put up the php file and tried to post a testfile from flickr and got an error. The post is made in pivot, but it isn't rebuilding the frontpage. Also using w.bloggar the posting is made, but it fails rebuilding the frontpage! |
| madjo wrote: |
| does the user have access to the category that script wants to add an entry to? |
| madjo wrote: |
| does that category even exist? |
| madjo wrote: |
| well, I'm not sure how flickr works, or what it does... can you select a category in that program? |
| madjo wrote: |
| well, I'm going to assume that Flickr places those photos in certain categories, and tries to post them to the same categories, and if those don't exist, the user indeed can't post it... |
| mngeoff wrote: |
| After you enter your API endpoint, Flickr should give a list of categories that you can post in, and you get to choose one. |
| Fredrik wrote: |
| You know, I could become a certified nutcase for less. I tried again today, adding my blog to flickr, and it worked. Without me doing anything new. It's crazy, I tell you, crazy.
My computer has been getting a habbit of freezing up lately. Maybe the last crash did some good, like getting rid of an evil cookie monster or something like that. Maybe. I'm glad it worked, but for once it would be nice to know why it works. Ah well, as the song goes: Don't worry, be happy. |
| mngeoff wrote: |
| Yes, the new XML/RPC version breaks the metaweblog extension.
To fix it, make these changes to metaweblog.php: --change all calls to piv_xmlrpc_encode to php_xmlrpc_encode --change all calls to piv_xmlrpc_decode to php_xmlrpc_decode Make sure you install the XML RPC patch before you change metaweblog.php. The modified version won't work with the old xmlrpc.inc. I'll try to get the modified version uploaded tomorrow. |
| hansfn wrote: |
| catarina76 - I guess it's neither. If you have switched language as described in my latest post in the UTF-8 thread, Pivot should be fine. I don't think a high-profile thing like Flickr is wrong. |
| Quote: |
| This is most likely a server issue. First check what encoding your browser is using - I guess you'll find that it still uses ISO-8859-1. This is because most Apache webserver has this as the default charset - adding "AddDefaultCharset Off" to your .htaccess file might fix it, it did for me.
|
| Quote: |
| PS! It would have been a million times easier to help if we could test/see your blog... |
| hansfn wrote: |
| I have two more suggestions:
1) The Pivot user that you use for the metaweblog, still don't use UTF-8 as charset. 2) The charset is undefined (and hence defaults to IS0-8859-1) in metaweblog.php. |
| Code: |
| function snippet_blogapi_autodiscovery() {
global $Weblogs, $Current_weblog, $Paths; $filname = basename($Weblogs[$Current_weblog]['front_filename'],'.php'); $filename = $Weblogs[$Current_weblog]['rss_path'].'rsd-'.$filname.'.xml'; $rsdfilename = fixpath($Paths['pivot_dir'].$filename); $rsdurl = fixpath($Paths['pivot_url'].$filename); // Some desktop blogging tools (Flock at least) needs to know the host explicitly... $rsdurl = $Paths['host'].$rsdurl; $blogurl = $Paths['host'].snippet_home(); $blogapiurl = $Paths['host'].$Paths['pivot_url'].'metaweblog.php'; $output = '<?xml version="1.0"?> <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd"> <service> <engineName>Pivot</engineName> <engineLink>http://pivotlog.net/</engineLink> <homePageLink>'.$blogurl.'</homePageLink> <apis> <api name="MetaWeblog" preferred="true" apiLink="'.$blogapiurl.'" blogID="'.$blogurl.'"/> </apis> </service> </rsd>'; write_file($filename, $output); $output = '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="'.$rsdurl.'">'; return $output; } |
| morpurgo.nl wrote: |
| Hi all,
I have used w.blogger and thats a nice tool but i wanted to blog from where ever i am without having to login in Pivot. I played with Writely and i made a post to my blog true you metaweblog API but i cant select the default category. If i post it takes, i think, the first one om alphabetic order so with the A. Does anyone knows how to solve this problem? |
| Quote: |
| If your client asks for a “Blog ID” (or “Site ID”), enter a case-sensitive category name. |
| Quote: |
| Administrative “superusers” can only edit their own posts. |
| Code: |
| /**
* Finds which cats are published by a certain blog. * * @param string $weblog * @return array */ function find_cats_in_weblog($weblog) { global $Weblogs; $cats = array(); foreach ($Weblogs[$weblog]['sub_weblog'] as $subweblog) { foreach ($subweblog['categories'] as $subweblogcat) { if (in_array($subweblogcat,$cats)) continue; $cats[] = $subweblogcat; } } return $cats; } |
| Quote: |
| Please test so I can commit the work - to be included in Pivot 1.31 |
| Code: |
| -function write_file($filename, $output) {
+function write_file($filename, $output, $mode='w') { - if ($fh = @fopen( $filename, 'w' )) { + if ($fh = @fopen( $filename, $mode)) { |
| hansfn wrote: |
| Please test with any other blog clients that might support newMediaObject. |
| Code: |
| on encodeAsBase64(theFilePath)
set thePath to quoted form of POSIX path of (theFilePath) set theScript to "openssl base64 < " & thePath return do shell script theScript as data end encodeAsBase64 |
| John wrote: |
| textMate does not seem to send a blog id. |
| Code: |
| ...<member><name>bits</name><value><base64>base64_encode_filecontents</base64></value></member> ... |
| hansfn wrote: |
|
You have probably have forgotten"<base64>...</base64>". It make sense doesn't it, to tell what encoding the bits have? Added: Or used the "string" in stead of "base64" |
| Code: |
| // Echo back what we received, before parsing it
if($this->debug > 1) { $this->debugmsg("+++GOT+++\n" . $data . "\n+++END+++"); } |
| Code: |
| debug("+++GOT+++\n" . htmlspecialchars($data) . "\n+++END+++"); |
| Code: |
| $payload = $payload . $r->serialize($resp_charset); |
| Code: |
| debug("+++SENT+++\n" . htmlspecialchars($payload) . "\n+++END+++"); |
| hansfn wrote: |
| Another tip: Add some debugging to includes/xmlrpc/xmlrpcs.inc so you see what Pivot (metaweblog.php) gets and sends. |
| Code: |
| <param>
<value> <struct> <member> <name>name</name> <value> <string>mytestimage.jpeg</string> </value> </member> <member> <name>type</name> <value> <string>image/jpeg</string> </value> </member> <member> <name>bits</name> <value> <string>/9j/4AAQSkZJRgABAgAAZABkAAD/7AAtRHVja3kAAQAEAAAAUAADABgAAAAKACAA IAAgACAAIAAgACAAIAAgACAAAP/uAA5BZG9iZQBkwAAAAAH/2wCEAAICAgICAgIC AgIDAgICAwQDAgIDBAUEBAQEBAUGBQUFBQUFBgYHBwgHBwYJCQoKCQkMDAwMDAwM ---SNIP--- rSlO/wBOAEE+aQo639WjsYVkL3ELtIbiWQNGUG9AqylifirU1r9GWwHPdil000IE EcFnbtA8rejPC6ckBI9XYkAsBWm3TGXmsUxli1KL6tHYXkl0jxj6zNLAyhYu3DhK DsKdFPfKtq3Tummn+pxnaINwNOcdSxEdfhDtRanlU9MeqjmmV0zBrAJGSDqUIuGQ 0ofRnoxr2pWu2TA33QUquVf/ABLp0gkT0RFIHh+EfsNQiqknbwYYtj//2Q==</string> </value> </member> </struct> </value> </param> |
| Code: |
| <param><value><struct><member><name>name</name><value><string>2006-08-26_jj_thumb_2.jpg</string></value></member><member><name>bits</name><value><base64>/9j/4AAQSkZJRgABAgAAZABkAAD/7AAtRHVja3kAAQAEAAAAUAADABgAAAAK
ACAAIAAgACAAIAAgACAAIAAgACAAAP/uAA5BZG9iZQBkwAAAAAH/2wCEAAIC AgICAgICAgIDAgICAwQDAgIDBAUEBAQEBAUGBQUFBQUFBgYHBwgHBwYJCQoK |
| john wrote: |
| the only differences I can see are the spaces and returns in the stuff sent by appleScript and the fact that appleScript incases the file data in <string> as opposed to <base64> |
| hansfn wrote: | ||
Which is exactly what I said above. You have tell AppleScript to enclose it in base64 since it is base64-encoded and not a string. Just to repeat the facts. |
| Quote: |
| Or used "string" in stead of "base64" |
| hansfn wrote: | ||
Just for the record: When I wrote
I was trying to tell you that it was an error to use string in stead of base64. OK, what I really wanted to tell you is the at least this Cocoa XML-RPC client supports base64 correctly (it seems). As you probably know other people have the same problem as you have - ref a quick Google search. |
| Code: |
| $xmlrpc_internalencoding = 'UTF-8'; |
output generated using printer-friendly topic mod. All times are GMT - 4 Hours