views:

124

answers:

2

Let's say there is a blog entry, which you have the HTML for, it looks like this:

<h1>Hi</h1>
<img src="http://thesource.com/someImage.gif"/&gt;
<p>And just a little more text, with a &nbsp;</p>

If you use the graph API to send this to Facebook, the message will look exactly as it appears above. I'm using HTMLCleaner in order to clean the HTML, which will remove all the HTML, so it looks more like:

Hi
And just a little more text, with a &nbsp;

Is there any way to send this to Facebook, and have them render it properly? Will I need to manually strip images out and place them back into the text that I send over? How can I get rid of special HTML characters like &nbsp;

+1  A: 

To convert the entities, use html_entitiy_decode()

And if you want to include images (or other media) in your stream post, you'll have to do that as an attachment.

Peter Bailey
I am using Java, I figured out how to decode the HTML, they probably should have been separate questions. The attachment will kind of work for me, the only issue I see is that I want the attachment to be in the post, so have some text, the image, then more text, is that even possible? I'll accept your answer regardless of whether you know that :)
walnutmon
No, it's not possible. Wall posts have to conform to FB's schema, and the message/description fields are plain text only.
Peter Bailey
A: 

I just clicked over from another site and figured I should take a look around. Like what I see so now I'm following you. Look forward to checking out your some of your posts again.

ugg boots