Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2006-06-24 19:24:41
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Using TextMate Blogging Bundle with Textpattern
Found it.
The blogging bundle specifies that the blog_id must be an integer. Hence, no matter what you try and reset it to, it will always come back as zero. See starting line 166 of blogging.rb.
Offline
Re: Using TextMate Blogging Bundle with Textpattern
I mentioned above that even hardcoding blog_id@ to whatever section you wanted (^) didn’t get me anywhere. Commenting lines 166..170 and adding in
blog_id = ‘log’@ I get the same problems as always, and ramanan didn’t seem to have any success either. Here’s the error I get just trying to xmlrpc to textpattern from ruby:
<pre><code>
[kjell@ambrose:~] % irb
irb(main):001:0> require ‘xmlrpc/client’
=> true
irb(main):004:0> c = XMLRPC::Client.new2(‘http://username:password@station11.net/rpc/’)
=> #<XMLRPC::Client:0×105c178 http_last_response=nil,
parser=nil, timeout=30,
path=”/rpc/”, password="password",
http_header_extra=nil, auth="Basic a2plbGw6cWFzcGVwcGRkc2x0",
use_ssl=false, host="station11.net",
user=“user”, proxy_port=nil,
cookie=nil, create=nil,
port=80, http=#<Net::HTTP station11.net:80 open=false>,
proxy_host=nil>
irb(main):005:0> c.call(‘metaWeblog.getRecentPosts’, ‘log (section)’, ‘user’, ‘password’, ’20 (numposts)’)
XMLRPC::FaultException: XMLRPC::FaultException
from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:414:in `call’
from (irb):5
</code></pre>
Using .call2
I can inspect what error the server is actually giving me:
<pre><code>
irb(main):008:0> r = c.call2(‘metaWeblog.getRecentPosts’, ‘log’, ‘user’, ‘password’, ‘20’)
=> [false, #<XMLRPC::FaultException: XMLRPC::FaultException>]
irb(main):011:0> r1.to_h
=> {“faultCode”=>-32602, “faultString”=>“server error. invalid method parameters”}
</code></pre>
That error is coming out of textpattern/lib/IXRClass.php
, textpattern’s xmlrpc library. That’s where I get lost. My parameters may indeed be invalid, but I think that I’m following both what the Blogging bundle does and what the ruby xmlrpc docs say. I have a pretty good handle on ruby, but php is far beyond me, so once I get to this part of the debugging I tend to give up ;)
Offline
#15 2006-06-24 20:59:10
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Using TextMate Blogging Bundle with Textpattern
That’s because once you comment it out it isn’t assigned at all.
Offline
Re: Using TextMate Blogging Bundle with Textpattern
I’m explicitly setting blog_id = ‘log’@, a section that I wouldn’t mind accessing.
<pre><code>
#if endpoint =~ /#(\d+)/
#
blog_id = $1.to_i
#else
# blog_id = 0
#end
blog_id = ‘log’
</code></pre>
I should mention that the xmlrpc works fine from MarsEdit (with metaweblog and the same settings), so either I’m doing something weird something up or ruby is. It’s even using blog_id = 1
and pulling down the articles.
Last edited by misterk (2006-06-24 21:02:51)
Offline
#17 2006-06-24 21:38:27
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Using TextMate Blogging Bundle with Textpattern
Ah, sorry, missed that. I’m in real top form, as usual…
Ugh, I don’t like these two languages trying to talk to each other craziness.
Okay, so IRB is tell you that according to Ruby,
c.call2('metaWeblog.getRecentPosts', 'log', 'user', 'password', '20')
are invalid method parameters, or at least, one of them is.
There must be another check somewhere that’s not right.
Offline
#18 2006-06-24 22:00:33
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Using TextMate Blogging Bundle with Textpattern
Despite what this says, Textpattern’s metaWeblog.getRecentPosts effectively ignores whatever blog_id is and just fetches all recent articles. If it couldn’t fetch them, for whatever reason, then you’d get back “problem_getting_articles” (it hasn’t been translated yet).
So we’re back to where we started…
Offline
Re: Using TextMate Blogging Bundle with Textpattern
Huh. if it weren’t raining, I’d go mow the lawn.
Offline
#20 2006-06-25 00:55:10
- dylansm
- New Member
- Registered: 2005-09-26
- Posts: 3
Re: Using TextMate Blogging Bundle with Textpattern
For what it’s worth, I have it working fine by just including the header “Format: 1” — the only problem I’m desparate to fix now is the problem uploading images. I get the following error:
/usr/lib/ruby/1.8/xmlrpc/client.rb:535:in /bin/bash: -c: line 1: unexpected EOF while looking for matching‘’
/bin/bash: -c: line 3: syntax error: unexpected end of filecall2′
from /usr/lib/ruby/1.8/xmlrpc/client.rb:399:in /bin/bash: -c: line 1: unexpected EOF while looking for matching ‘’
/bin/bash: -c: line 3: syntax error: unexpected end of filenewMediaObject’
from /Users/dylan/Library/Application Support/TextMate/Pristine Copy/Bundles/Blogging.tmbundle/Support/lib/blogging.rb:708:in /bin/bash: -c: line 1: unexpected EOF while looking for matching‘’
/bin/bash: -c: line 3: syntax error: unexpected end of filepopen’
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/progress.rb:11:in /bin/bash: -c: line 1: unexpected EOF while looking for matching ‘’
/bin/bash: -c: line 3: syntax error: unexpected end of fileupload_image’
from /tmp/temp_textmate.1E2RQ0:3
Otherwise things seem to be fine. Make sure that you fix the Content-Type header as mentioned here:
http://textpattern.com/weblog/201/xml-rpc-support-for-textpattern-403-is-here#c000287
Has anyone been able to successfully upload images using TextMate?
Offline
Re: Using TextMate Blogging Bundle with Textpattern
That doesn’t seem to work. It gets rid of the error (sometimes), but doesn’t save anything.
If you read the docs, I think it mentions that uploading isn’t implemented yet. (I think.)
Last edited by ramanan (2006-06-25 16:01:13)
Offline
#22 2006-06-26 04:09:50
- dylansm
- New Member
- Registered: 2005-09-26
- Posts: 3
Re: Using TextMate Blogging Bundle with Textpattern
Sorry. I get it now, and I’m having the same problem with identifying Textpattern sections. No luck. I’m hoping someone gets somewhere with this soon as I’m really excited about using this.
Offline
#23 2006-06-26 06:14:30
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Using TextMate Blogging Bundle with Textpattern
It’s Pedro’s baby so he’s more able to find and fix the problem than I can. I was hoping he’d step in here, but I think he hasn’t seen this thread. I’m just about to send him an email and make sure he knows.
Offline
#24 2006-06-26 22:23:47
- dylansm
- New Member
- Registered: 2005-09-26
- Posts: 3
Re: Using TextMate Blogging Bundle with Textpattern
One more thing: I can’t get the excerpt/cut feature to work. This would be really, really great, too.
Offline