List Info

Thread: extra DIV wrapper




extra DIV wrapper
user name
2006-05-13 06:30:32
I've seen a few posts here asking how to get rid of the
extra div that
posting to Blogger via the Atom API throws in your entry:

<div xmlns="http://www.w3.org/1999/x
html">content of your post</div>

In PHP, once you've retrieved the entry, this script should
pull out
all such divs where $string is the entry you've fetched:

while ( preg_match('%^<div
xmlns="http://www\.w3\.org/1999/xhtml"
;>(.*)?(</div>)$%is',
trim($string), $_MATCH) )
{
$string = trim($_MATCH[1]);
}
$unwrapped_string = $string;

The regex expression above should be:

%^<div xmlns="http://www\.w3\.org/1999/xhtml"
;>(.*)?(</div>)$%is'

(Mind the gap.)

It's not extensively tested and I'm no regex expert, but
that worked on
a couple examples I threw at it.  Feel free to improve on
it, if
necessary.

You can also find this code on my blog:

http://phosphorusandlime.blogspot.co
m/2006/05/php-blogger-wrapper-regex.html


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "bloggerDev" group.
To post to this group, send email to bloggerDevgooglegroups.com
To unsubscribe from this group, send email to
bloggerDev-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/bloggerDev
-~----------~----~----~----~------~----~------~--~---

extra DIV wrapper
user name
2006-06-01 09:37:13
Tom wrote:

> I've seen a few posts here asking how to get rid of
the extra div that
> posting to Blogger via the Atom API throws in your
entry:
>
> <div xmlns="http://www.w3.org/1999/x
html">content of your post</div>
>
> In PHP, once you've retrieved the entry, this script
should pull out
> all such divs where $string is the entry you've
fetched:

Nice workaround, but not much more, specially not a solution
to
problem. This issue is worked on (at least that was
announced here) by
Blogger dev team and we hope it will be resolved sooner or
later.

Cheers
Jarek Zgoda


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "bloggerDev" group.
To post to this group, send email to bloggerDevgooglegroups.com
To unsubscribe from this group, send email to
bloggerDev-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/bloggerDev
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )