Recent Topics

1 Jan 06, 2005 16:34    

Go easy on me but I just don't get it. I can go to my flickr site and blog to blogger no problems. In fact it works so well that I am interested in blogger :lol:

I have read about Blogger API and on the forum it seems to mention that is how it is done.

I had to setup b2evolution with a script as I am so slow so can someone give me a step by step solution to automaticaly post to b2 from www.flickr.com?

Thanks

2 Jan 07, 2005 15:13

I found a link to Tor's blog that has instructions, but I could never get it to work...it kept telling me my endpoint wasn't valid. :(

3 Jan 07, 2005 20:12

Tor will most likely be integrating the necessary changes directly into the next release of b2evo ;)

4 Jan 09, 2005 20:36

If you'd like to do some beta testing I'd be happy to send you the xmlrpc Beta - which implements a slightly expanded version of the code.

Regards
Tor
tor@gisvold.co.uk

5 Jan 10, 2005 02:22

How hard would it be to upgrade and test?

I use ace-host.net and they currently have version 0.9.0.10 installed.

I would require instructions but happy to test. If I had a list of changes I could test them also.

I am very computer proficient with 20 years online experience but only just getting into php and linux ;)

Thanks.

6 Jan 10, 2005 14:14

I can find some additional donations when flickr works with b2 :-)

7 Jan 10, 2005 15:12

Tor - I would be very interested in testing.

8 Jan 22, 2005 11:58

Tor - I am very interested in your modified "xmlrpc.php" to get this flickr thing going....

9 Jan 24, 2005 21:59

If you'd like me to email you the "hacked" xmlrpc file, please email me at "tor at gisvold.co.uk" - of course you need to replace the (at) with the correct sign.

I have added all the new code to the b2evolution CVS, so hopefully this will be included in the nect official release of b2.

Regards
Tor

10 May 13, 2005 01:31

I have set this up with the beta version of xmlrpc.php, however I can't specify the category. I can live with this if I must (better than the alternative!), but wasn't the 'category' supposed to be added to the top of the Flickr template setting? I did this, but the category number just shows up at the top of my post, and the post itself always goes into the same category no matter what.

Any ideas?

Example here: http://fernard.com/markblog/?blog=2 (post with the pic of a guy with a big head. )

11 May 14, 2005 16:54

A small cautionary note - the Flickr API and all its XML is rather variable. I spent a fair time building an RSS 2 HTML Search Flickr by tag application for a client and it never held up for very long.

I also wonder whether they are slightly more business-minded about XML usage since acquisition by Yahoo

12 May 16, 2005 14:04

Thanks for the file Tor

I've set everything up and was quite excited to see a Flickr test appear in my set blog under the correct category but as yet a test image has not yet appeared. I'm sening the images to flickr by email because my ultimate aim is to create a camphoneblog

http://neukol.org.uk/b2/animatus/index.php/photoblog

still no pic - any ideas?

13 May 16, 2005 15:05

oops, my mistake - operator error

it's working now

http://neukol.org.uk/b2/animatus/index.php/photoblog

It goes into the specified category (which is the only category on that blog) but also puts the number into the posting.

Very nice - I'm please with this. Now I wonder if it is possible to set up so that the image is only posted as A PROTECTED posting meaning it awaits moderation.

[edit]

tried removing the ability to post as "published" leaving only "protected" but the email posting via flickr doesn't happen at all.

14 May 27, 2005 18:05

Alas I am getting

The endpoint you entered was not correct.

from flickr.

when I go to the file, using the same URL, in my browser I get

Warning: main(/home/nihonbun/public_html/xmlsrv/../b2evocore_main.inc.php): failed to open stream: No such file or directory in /home/nihonbun/public_html/xmlsrv/xmlrpc.php on line 21

Fatal error: main(): Failed opening required '/home/nihonbun/public_html/xmlsrv/../b2evocore_main.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/nihonbun/public_html/xmlsrv/xmlrpc.php on line 21 


This seems to show that I have specified the right URL (it is finding line 21)
The error message could be because my b2evo is not of the right version to cope with the hacked file uploaded by Tor. I am using " 0.9.0.11"

I can not seem to find the file "_main.inc.php"

In the folder "b2evocore" there only seems to be a file called "_main.php" and no _main.inc.php.

And in any case, the path does not seem to be specified correctly.

The path that it is attempting to include is
'/home/nihonbun/public_html/xmlsrv/../b2evocore_main.inc.php'
the fact that there is a "b2evocore" there suggests to me that it is trying to look into the folder b2evocore, but it should be (even assuming that it wants to include _main.php not "main.inc.php") is

'/home/nihonbun/public_html/b2evocore/_main.php'

I will try hardwiring the "require" to the above.

I did that and now there seems to be a slight improvement. It seems to get past line 21, since it is now finding a file, and now it says

Warning: fopen(/home/nihonbun/public_html/xmlsrv/xmlrpc.log): failed to open stream: Permission denied in /home/nihonbun/public_html/xmlsrv/xmlrpc.php on line 38

Warning: fwrite(): supplied argument is not a valid stream resource in /home/nihonbun/public_html/xmlsrv/xmlrpc.php on line 41

Warning: fclose(): supplied argument is not a valid stream resource in /home/nihonbun/public_html/xmlsrv/xmlrpc.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home/nihonbun/public_html/xmlsrv/xmlrpc.php:38) in /home/nihonbun/public_html/b2evocore/_functions_xmlrpcs.php on line 208
faultCode 103 faultString XML error: no element found at line 1 

Looking at the first of the lines that is failing

$fp = fopen( dirname(__FILE__).'/xmlrpc.log',"a+");

coud it be that the function dirname was introduced after my version? No, that is not it because line 20

require_once(dirname(__FILE__).'/../conf/_config.php' );


is being parsed without issue. Hmm... ah. in the folder xmlsvr there is no file called "xmlrpc.log." Perhaps this is a permissions problem - it cannot create the log file?

Aha...looking good, but very dangerous (please do not punish me for my ignorance)...relaxing the permissions on said folder, I find that it now only says

faultCode 103 faultString XML error: no element found at line 1 


When I go to the URL of my xmlrpc.php

This is looking good. There are no php proplems, it is just lacking xml to parse, it would seem.

But all the same the flickr page is still saying

The endpoint you entered was not correct.

I have no idea why. Perhaps this is because it really needed "main.inc.php" and not "main.php"?

When I added a "www" into the URL, it made no difference at flickr, but when I go to that URL with the www I now see XML displayed as follows.

<?xml version="1.0" ?>
- <methodResponse>
- <fault>
- <value>
- <struct>
- <member>
<name>faultCode</name>
- <value>
<int>103</int>
</value>
</member>
- <member>
<name>faultString</name>
- <value>
<string>XML error: no element found at line 1</string>
</value>
</member>
</struct>
</value>
</fault>
</methodResponse>

Tim

15 May 31, 2005 11:02

I promise $100 to the person (or if that person prefers, to Francois PLANQUE) who is kind enough to get my b2evolution to work with flickr.

16 May 31, 2005 11:15

Shouldn't this :-
/home/nihonbun/public_html/xmlsrv/../b2evocore_main.inc.php

read :-
/home/nihonbun/public_html/xmlsrv/../b2evocore/_main.inc.php

¥

17 May 31, 2005 12:19

Yes, indeed. I am not sure why it is coming up without the / so instead of using the function call, i wrote in the path of the file, removing the "inc" because I do not have a file with "inc" in it. I guess that I must be using a different version.

Tim

18 May 31, 2005 12:54

I'm using the same version as you, on my install it's found @

blogs/evocore/_main.inc.php

¥

19 May 31, 2005 13:10

blogs/evocore/ ? I am not even looking in the right folder. (I am looking in "b2evocore")

Ummm I do not have any folder called blogs. And the only "evocore" folder seems to be the "b2evocore" and there is no _main.inc.php inside it. Only a _main.php or the nearest other thing is _blog_main.php...

The file _main.php begins with

<?php
/**
 * This file initializes everything BUT the blog!

Thanks for the suggestions. [/code]

20 May 31, 2005 18:24

Okay first things first:

1) In Flickr / Account / Your Blogs you have to choose 'BloggerAPI enabled blog'

2) The endpoint is something like this: http://yoursite/xmlsrv/xmlrpc.php

3) If you get "The endpoint you entered was not correct."; you might want to check the first lines of the xmlrpc.php file. There is a sall bug in version 0.9.0.12 and if you don't use the standard folder structure you might want to copy/paste the following:

/**
 * Initialize everything:
 */
require_once(dirname(__FILE__).'/../conf/_config.php' );
require_once(dirname(__FILE__)."/$xmlsrv_dirout/$core_subdir/_main.php" );

4) You might want to set up a special user for Flickr, but make sure you give him the permission to post *published* posts to the blog you are targetting.

5) By the way, what blog are you targetting? This is the trickiest issue! By default Flickr will post into category #1 which is in most likely in blog "A" (#2). At least this is the default b2evo install.

If you want to post to another category/blog, you must edit /conf/_advanced.php around line 98 and change the following:

# by default posts will have this category
$default_category = 1;


Replace 1 with the number of the category you want to post to.

Using this I was able to post the Flickr TEST post (from the bloigs setup page). I wasn't able to post a picture though... Why not is beyong me. And since Flickr won't show the error message returned by b2evo I'm a little bit pissed off and don't feel like investigating this further right now.

Please let me know how this works for you guys.

21 May 31, 2005 18:54

Dear God,

Thank you for your response.

BloggerAPI??? The guy that made he xmlrpc.php that I am now using (see thread above) Tor, from Norway, living in England, says that we should use the universal api (? or common api, or something), NOT
the blogger api.

Does this mean that b2evolution was already flickr enabled and that
he and others where simply not using the right api interface?

Hmm...I is annoying that the flickr thing does not show the error messages.

I will give your suggestion a try.

Thank you,

Tim

22 May 31, 2005 18:55

I know this is no help but I used Tors instructions and his file and it worked. I can now fire Flickr images into B2.

23 May 31, 2005 19:12

Thank's Steve....

I could have sworn I used Tor's instructions.

Perhaps the problem is
1) I go the file from the CVS not tor directly.
2) My installation is non standard?
3) My version is different.

Your blog is cool. I am jealous.

24 May 31, 2005 19:21

Yes, Tor has been adding another API indeed.
My approach however is to use the blogger API which has been implemented in b2evo forever.
I'll give Tor's API a try...

25 May 31, 2005 19:44

Well if God is going to do it then I will wait.
Tim

26 May 31, 2005 22:58

François
With your posting here, I was able to post the flickr test post
with Tors instructions I even didn't get to there.
But an actual photo is not possible.
Indeed, the only error I got in return was

Your blog posting failed

27 Jun 02, 2005 05:28

I am getting XML from the endpoint but "endpoint is incorrect" even if I use the blogger enabled API or the MetaWebllog API that tor recommends. It is not the password combination since

http://nihonbunka.com/xmlsrv/xmlrpc.php

3) If you get "The endpoint you entered was not correct."; you might want to check the first lines of the xmlrpc.php file. There is a sall bug in version 0.9.0.12 and if you don't use the standard folder structure you might want to copy/paste the following:
Code:
/**
* Initialize everything:
*/
require_once(dirname(__FILE__).'/../conf/_config.php' );
require_once(dirname(__FILE__)."/$xmlsrv_dirout/$core_subdir/_main.php" );

This is pretty much exactly what I had done (except without using the variables) Thanks for confirming that _main.php is okay. I had already set up xmlsrv.php to use that file (and not _main.inc.php as it had there originally). I think that I must be getting config.php too else I would see an error.

I am not sure why I need a special user...I am using the admin user who can post anywhere.

28 Jun 02, 2005 13:30

I have
if( !isset($default_to_blog) ) $default_to_blog = 2;
# by default posts will have this category
$default_category = 1;
So I guess that that is not the problem.
Tim

29 Jun 02, 2005 13:33

You do not need a special user. It's just that you might not want to give your admin password to the flickr guys :P

31 Jun 03, 2005 05:23

I may, even in my ignorance, be getting somewhere...

I released that there are logs. (I am not sure why I can not delete, change, or CHMOD the log file - why!?) And the log says:

2005-06-02 19:08:25  Input: Called method:metaWeblog.getUsersBlogs

2005-06-02 19:08:25  Output: <methodResponse><fault>
  <value>
    <struct>
      <member>
        <name>faultCode</name>
        <value><int>1</int></value>
      </member>
      <member>
        <name>faultString</name>
        <value><string>Unknown method</string></value>
      </member>
    </struct>
  </value>
</fault></methodResponse>

2005-06-02 19:08:25  Input: Called method:blogger.getUsersBlogs

2005-06-02 19:08:25  Output: entered bloggergetusersblogs.

2005-06-02 19:08:25  Output: user approved.


So I presume that input is what flickr is saying to b2evo and output is what b2evo is saying back.

First of all flickr asks for a list of blogs using the following method.
Called method:metaWeblog.getUsersBlogs
But flickr's response is that there no such method.

Then flickr sends
Called method:blogger.getUsersBlogs
And this method does exist (there is a function bloggergetuserblogs - I am not sure why there is no ".") but instead of returning a list of blogs, it is only repeating flickr's command ("entered bloggergetusersblogs")

Loonking at the function it is easy to see that it is meant to log output

2005-06-02 19:08:25 Output: entered bloggergetusersblogs.

2005-06-02 19:08:25 Output: user approved.

But it is not getting as far as

718	logIO("O","Got Current user.".$current_User);

Could that be because I am not logged into b2evolution. No I tried logging in and it did not make a difference.

Aha..there is also an error log file. In that it says:

[02-Jun-2005 20:09:31] PHP Fatal error: Call to a member function on a non-object in /home/nihonbun/public_html/xmlsrv/xmlrpc.php on line 717
And indeed link 717 corresponds to the line to get the user data.

	$current_User = & $UserCache->get_by_ID( $userdata['ID'] );

Perhaps the problem is that somewhere in b2evo there is somethign that prevents external xml calls from getting the userdata for the administrator and that Fplanque has avoided this problem by his increased sense of security awareness (using another username as suggested above)?

No...I tried making a new user and giving that user privelidges to post to blog 2 but I get the same error. Perhaps I need to be logged in as that user? No. Logging in as the new uers did not seem to make any difference.

32 Jun 09, 2005 16:27

Lately I just "blog" at flickr!
Tim

33 Jun 17, 2005 03:14

b2evo 0.9.0.10, using Blogger API setup on flickr, I am able to get the flickr test post to appear on my blog (although flickr reports a failure) but I cannot seem to get photographs to appear, or the associated text.

34 Jun 17, 2005 04:02

Dear MikkyT

You got further than me. I downloaded the file from CVS but as you can see above it hangs when it attempts to get data about the user.

Tim

35 Jun 19, 2005 01:17

timtak wrote:

Dear MikkyT

You got further than me. I downloaded the file from CVS but as you can see above it hangs when it attempts to get data about the user.

Tim

I'd didnt download anythin, I am using the php file from 0.9.0.10

36 Jun 19, 2005 09:56

I just set up another flickr blog yesterday for someone and I had a hell of a job remembering what to do so I'm going to write a step by step guide to remind myself as much as anything

    in your flickr account go to "your blogs" click on set up new blog in the dropdown choose - MetaWeblogAPI Enabled Blog- click next Enter your logon details ENDPOINT = http://www.yourdomain.com/yourB2_install/xmlsrv/xmlrpc_test.php (xmlrpc_test.php is teh file that Tor sent me. A friend tells me it is full of errors but it does the trick enter your username and password carefully Click next and you will then see a drop down of allthe blogs that your username and password is allowed to post to choose a blog and click next Now you can create a custom posting template or view the list of blogs TOR reccomends adding <category>29</category> (with YOUR category number) at the top of your chosen posting template but I find it works without it and just goes into the first category created for that blog I just tested what I did above and the results are here http://neukol.org.uk/teesblog/index.php/light (that's not my blog so I'll have to clean it off after a while) now you can go to any of your flickr pics and click "blog this" - I just ran a test and it works at the URL above Now I've been going a stage further than this so I may as well write this up too I wanted to be able blog by email and I've now set up several for mobile phone users. CLICK ON "uploading photos to your blog by email" - choose a template and save You will then be presented with the email address to use for your postings [/list:u] THAT'S IT !! all that's missing is the xmlrpc_test.php that TOR sent me. I would simply post it here for copying and pasting but I wonder why Tor (or anybody else) never did this? Would I be breaking some taboo by doing so. If soemone tells me it's OK I'll come back and add the code for that file. Like I say it all works for me and it seems fairly easy[/url]

37 Jun 19, 2005 12:10

I may not have hte same file as you since I downloaded the one I am using from the CVS. It was the second of two versions that Tor had uploaded there.

I had to change it a little to get anything to happen, as noted above, but even so it never gets to
> Click next and you will then see a drop down of allthe blogs
> that your username and password is allowed to post to choose
> a blog and click next

I would be grateful of the xmlrpc_test.php code.

Timothy

38 Jun 19, 2005 20:11

Okay I've decided to fix this myself, using the BloggerAPI method that fplangue suggests (thats not Tor's one, its the original - mine is version 0.9.0.10).

First thing, I've turned on logging in the script (you'll need to CHMOD xmlrpc.log in the xmlsrv directory to 666).

The failure message is being generated in flickr because the script outputs an error :

faultCode
103


faultString
XML error: no element found at line 1

This is output even though the post was successful.

Additionally, when attempting to blog a photograph I get an additional error:

faultCode
806


faultString
Cannot post, please correct these errors: Illegal tag: style

39 Jun 19, 2005 20:33

Woo hoo success...

b2evolution does not like the CSS being passed by flickr, so I removed the sytle code from the flickr layout and voila, it works!

40 Jun 19, 2005 21:04

mikkyT, you are an angel for me !
thank you very mutch for finding this out !

41 Jun 19, 2005 21:09

http://blogs.mikkysworld.com/index.php/camblog/2005/06/19/title

There we go... unfortunately I haven't yet figured out how to add a title ... the xmlrpc.php script has a default title setting at the top, so I presume there is no mechanism within blogger API to specify one?

Also, my sig hasn't been updated, so I guess the script I use for that hasn't been told there's a new post from a remote source

42 Jul 12, 2005 23:55

Thanks. I will have a go at doing this. But if the person (stevet) that has Tor's script would be so kind as to send it to me (nospam[at]nihonbunka.com - please convert the [at] to the relevant character) then I would be very grateful.
Tim


Form is loading...