gblogger raw html posting

3 views
Skip to first unread message

Alexander Gromnitsky

unread,
Sep 28, 2008, 8:17:59 PM9/28/08
to emacs-g-client
Hi,

Does anyone know how to disable in g-client inserting <br />
after each newline in a body part of a message? I want to post into
the blogger in the raw html.

As I understand, this magic is in (g-app-send-buffer) function in g-
app.el file where curl is executed, so may be the question is about
curl itself.

Thanks in advance.

ramanraman

unread,
Sep 28, 2008, 9:59:42 PM9/28/08
to emacs-g-client
I dont believe g-client automatically adds br tags in the HTML
--- can you show me an example where this happens so I can debug
it further?

Alexander Gromnitsky

unread,
Sep 28, 2008, 11:04:42 PM9/28/08
to emacs-g...@googlegroups.com
Sun Sep 28 2008 18:59:42 -0700, ramanraman wrote:

> I dont believe g-client automatically adds br tags in the HTML

:)

> --- can you show me an example where this happens so I can debug
> it further?

OK, I'll try to show that behaviour with maximum accuracy. There will be
very-very long lines in the mail, I'm sorry for that.

Step 0: M-x gblogger-new-entry

[...]

Step 1: constructing the message.

--------------------------------
<entry xmlns='http://www.w3.org/2005/Atom'>
<generator url="http://purl.org/net/emacs-gblogger/">http://purl.org/net/emacs-gblogger/</generator>
<author> <name>Alexander Gromnitsky </name> </author>
<title mode="escaped" type="text/html">test entry </title>
<content type='xhtml'>
<div xmlns="http://www.w3.org/1999/xhtml">
1
<b>2</b>

3
</div>
</content>
</entry>
--------------------------------

We are expecting to have 3 digit in one line: "1 2 3", but...

Step 2: hitting C-C C-C in emacs.

[The message posted successfully]

Step 3: looking at the result from Blogger.

--------------------------------
HTTP/1.1 201 Created
Content-Length: 1449
Date: Mon, 29 Sep 2008 02:41:24 GMT
Cache-Control: private, no-store, must-revalidate
Content-Type: application/atom+xml; charset=UTF-8
GData-Version: 1.0
Location: http://www.blogger.com/feeds/8518021139708603317/posts/default/2474337108256964157
Content-Location: http://www.blogger.com/feeds/8518021139708603317/posts/default/2474337108256964157
Server: GFE/1.3
Age: 2
Connection: keep-alive
Warning: 110 chantecler.medieval:8123 Object is stale

<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><entry xmlns='http://www.w3.org/2005/Atom'><id>tag:blogger.com,1999:blog-8518021139708603317.post-2474337108256964157</id><published>2008-09-29T05:41:00.001+03:00</published><updated>2008-09-29T05:41:24.391+03:00</updated><title type='text'>test entry</title><content type='html'>&lt;br /&gt; &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;br /&gt;1&lt;br /&gt;&lt;b&gt;2&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3&lt;br /&gt; &lt;/div&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2474337108256964157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8518021139708603317&amp;postID=2474337108256964157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2474337108256964157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2474337108256964157'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/test-entry.html' title='test entry'/><author><name>Alexander Gromnitsky</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>alexander....@gmail.com</email></author></entry>
--------------------------------

Step 4: looking at the result on the web:

http://gromnitsky.blogspot.com/2008/09/test-entry.html

PS
g-client is the latest (from svn).

lackita

unread,
Oct 10, 2008, 1:36:18 PM10/10/08
to emacs-g-client
This is actually a rather subtle issue. Basically, g-client is
sending content-type as text/plain instead of text/html. I believe
you can accomplish this by adding <code>-H 'Content-Type: text/xml'</
code> to the G Curl Common Options variable in the customization
menu. I should add the caveat that when I ran into this problem it
was trying to make posts by email, not use the gdata api, so I'm not
100% sure it will work.

On Sep 28, 11:04 pm, Alexander Gromnitsky
> Location:http://www.blogger.com/feeds/8518021139708603317/posts/default/247433...
> Content-Location:http://www.blogger.com/feeds/8518021139708603317/posts/default/247433...
> Server: GFE/1.3
> Age: 2
> Connection: keep-alive
> Warning: 110 chantecler.medieval:8123 Object is stale
>
> <?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><entry xmlns='http://www.w3.org/2005/Atom'><id>tag:blogger.com,1999:blog-8518021139708603317.post-2474337108256964157</id><published>2008-09-29T05:41:00.001+03:00</published><updated>2008-09-29T05:41:24.391+03:00</updated><title type='text'>test entry</title><content type='html'>&lt;br /&gt;    &lt;div xmlns='http://www.w3.org/1999/xhtml'><br/&gt;1&lt;br /&gt;&lt;b&gt;2&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  </content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2474337108256964157/comments/def...title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8518021139708603317&postI...title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/247433...><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/247433...><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/test-entry.html'title='test entry'/><author><name>Alexander Gromnitsky</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>alexander.gromnit...@gmail.com</email></author></entry>

lackita

unread,
Oct 10, 2008, 1:38:50 PM10/10/08
to emacs-g-client
Speaking of using text instead of html, the code tags didn't behave
correctly in my previous post. Also, it should be text/html, not text/
xml. If you want the details on my experience with this issue, head
over to http://lackita.blogspot.com/2008_01_01_archive.html.
> > <?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><entry xmlns='http://www.w3.org/2005/Atom'><id>tag:blogger.com,1999:blog-8518021139708603317.post-2474337108256964157</id><published>2008-09-29T05:41:00.001+03:00</published><updated>2008-09-29T05:41:24.391+03:00</updated><title type='text'>test entry</title><content type='html'>&lt;br /&gt;    &lt;div xmlns='http://www.w3.org/1999/xhtml'><br/&gt;1&lt;br /&gt;&lt;b&gt;2&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;  </content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2474337108256964157/comments/def...Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8518021139708603317&postI...t...Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/247433...><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/247433...><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/test-entry.html'title='testentry'/><author><name>Alexander Gromnitsky</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>alexander.gromnit...@gmail.com</email></author></entry>

Alexander Gromnitsky

unread,
Oct 10, 2008, 11:42:16 PM10/10/08
to emacs-g...@googlegroups.com
Fri Oct 10 2008 10:38:50 -0700, lackita wrote:

> Speaking of using text instead of html, the code tags didn't behave
> correctly in my previous post. Also, it should be text/html, not text/
> xml. If you want the details on my experience with this issue, head
> over to http://lackita.blogspot.com/2008_01_01_archive.html.

It doesn't work for the gdata api. After hitting C-C C-C:

--------------------------------
HTTP/1.1 415 Unsupported Media Type
Content-Length: 36
Date: Sat, 11 Oct 2008 03:34:44 GMT
Expires: Sat, 11 Oct 2008 03:34:44 GMT
Cache-Control: private, no-store
Content-Type: text/plain; charset=UTF-8
Server: GFE/1.3
Age: 1


Connection: keep-alive
Warning: 110 chantecler.medieval:8123 Object is stale

Content-Type text/html is not valid.
--------------------------------

Alexander Gromnitsky

unread,
Oct 12, 2008, 1:20:27 AM10/12/08
to emacs-g-client
On Sep 29, 3:17 am, Alexander Gromnitsky
I've looked into Settings->Format in the Blogger and discovered
"Convert line breaks" combo-box. Hm... Better late than never.

lackita

unread,
Oct 12, 2008, 11:14:46 PM10/12/08
to emacs-g-client
Oh well, guess my blogspot woes were different than yours, sorry it
dien't help.

On Oct 10, 11:42 pm, Alexander Gromnitsky
<alexander.gromnit...@gmail.com> wrote:
> Fri Oct 10 2008 10:38:50 -0700, lackita wrote:
>
> > Speaking of using text instead of html, the code tags didn't behave
> > correctly in my previous post.  Also, it should be text/html, not text/
> > xml.  If you want the details on my experience with this issue, head
> > over tohttp://lackita.blogspot.com/2008_01_01_archive.html.
Reply all
Reply to author
Forward
0 new messages