Peter's Blog

Another guy talking nonsense!

How to post long text on Facebook?

with 23 comments

Some time ago I’ve wanted to post excerpt from the book I was reading on Safari Books Online on my Facebook wall. Everyone who have ever used Safari knew that their books are displayed in special way, so you can only use their applet to copy text (probably they’ve done that to avoid people copying entire books). As a result you’ll obtain text which would reside in your clipboard. To publish it on Facebook you need just to paste it into appropriate field and…

Yes, Facebook limits text to be posted to 420 characters, so if you want to post something longer you need to find other way. And that’s how Text Hoster was born. It’s web application written by me to host text which can then be posted to Facebook. When you’ll go to you’ll find a field to enter your text and Send button, I believe it’s self explanatory. When you’ll click Send simple check is done to calculate length of your string, so if it’s less than 420 characters then it would not be hosted as there is no reason for it. Then you’ll see a page with your text, full link to your text, shortened link and Facebook share button. After clicking Share you’ll be navigated to page as the one below.

It’s typical representation of Facebook generated link, as you can see there is shortened version of the text and link, you can also add short description to it. Now click share again and voila your text is on your Facebook wall (of course you should be logged before sharing or you’ll be asked to log in), when somebody would click on it he would be navigated to hoster page and able to read full text.

Now let me say a little about project itself. It’s written in PHP and all data is kept in MySQL DB. It was great opportunity to learn new things, so I’m happy that I’ve done it, but I know that there are probably better ways to do the same. My wife says it’s waste of time as you can simply make a screenshot, publish it somewhere and post a link to it on FB, I love to receive support from my spouse. But no chance of learning something new is ever waste of time and if you’ll post image you would block ability to copy your text to your readers (which is not always so bad). Anyway in current shape it’s exactly what I’ve wanted it to be. Light, simple to use and creates descriptive Facebook posts. This took me some time as when I’ve written the app posts generated by it contained text from the app itself, not shortened version of hosted text. But I’ve studied FB documentation and found out that you need to specify two meta tags:

And fill them with information you want to be part of FB link. So I’ve created simple formula to do that. I could probably go without using to shorten links, but I find them looking better than the long ones and it should be useful when sharing text outside FB, for instance via IM.

At the end I would like to say that this project has been created just for learning purposes and to help people who would want to post long text to Facebook. That’s why I’m not taking responsibility for texts hosted in my apps (as I’m not able to control that) and reserve the right to close it down and swipe DB if it would be abused. If you have any proposition of improvement, want to report abuse or bug, or just want to say something about this app please do so by commenting this post.

UPDATE1: I’m escaping special characters to prevent SQL injection, so instead of ‘ you’ll see \’. I hope I would figure out something better soon. Haha! I’ve solved it! I couldn’t go to sleep knowing that my “baby” is not acting as it should:) Now you can enjoy your text being displayed in exact way you’ve provided it.

UPDATE2: Must figure out how to maintain correct alignment of text, so it would display exactly how you’ve formatted it, not in one line as it’s now. But that needs to wait, I’m tired, goodnight. Done. Now you can enjoy beauty of line breaks thanks to nl2br command. I’ve also added auto select function to link fields. Enjoy!

UPDATE3: I’ve finally implemented what should be operational from the start, displaying instead of interpreting HTML code. I know, it was very lame that I haven’t thought about it earlier. I hope that nobody got harmed because of that.

UPDATE4: We now have add-on for Firefox, so you can post texts on Facebook even faster! This add-on has been blocked by Mozilla as per request from Facebook, read more here.

UPDATE5: Now Arabic texts are being displayed as they should, right to left. Thanks to regular expressions a little automation was possible here.

UPDATE6: Added Tweet button and email address where you can report abuse.

Written by Peter

June 14th, 2010 at 7:20 pm

Posted in IT,Main

Tagged with ,

23 Responses to 'How to post long text on Facebook?'

Subscribe to comments with RSS or TrackBack to 'How to post long text on Facebook?'.

  1. hey… your grammar is awful for my brain lol

    Sweed Test

    7 Sep 10 at 11:28 pm

  2. Sorry to hear that:( Trying to improve.


    8 Sep 10 at 9:27 am

  3. Holy cow – sooooooo simple, so few button to click, worked so well and just Exactly what I wanted to update my friends on my surgery today! LOVE it.

    Your grammar’s not bad. Pat on the back to you, friend and thanks.


    27 Oct 10 at 7:42 am

  4. this is great! thank you so much :)


    20 Dec 10 at 12:17 pm

  5. It is not encoded well for arabic language


    25 Feb 11 at 8:53 pm

  6. If you’ll give me some example I could take a look.


    25 Feb 11 at 9:02 pm

  7. OK, I think I’ve got it. Characters were actually displayed correctly, but order was left to right. It’s fixed now.


    26 Feb 11 at 1:54 am

  8. Hi there,
    I can not post Arabic comments on my face book page on on my friends pades too.
    I am not typing directly.I type on other place then I copy and paste it.It is first time such problem took place.I am a user of face book more since about 2 years.But it is the first time I face such problem.
    Please help.
    Thank you.


    30 Mar 11 at 11:41 am

  9. Unfortunately I have no ability to support you with Facebook. But if you referring to my site then please be more specific.


    30 Mar 11 at 12:12 pm

  10. How to do to manage to publish more than 420 characters in the publications of the facebook? I lowered your program and it did not work! Sorry for my english I used a translator.

    Plinio Gaius

    12 Apr 11 at 6:12 pm

  11. We probably have here the same misunderstanding as I’ve noticed people have with my Firefox add-on. My site is not extension of Facebook, I’m not related to Facebook by any means. My site is only hosting your text and linking it on Facebook, just as you would share movie on Youtube for instance. Usage is pretty easy, paste your text on site, click send, then check if it looks like you wanted and click share. It would get you to Facebook page and you’ll need to click share again. Hope it helped.


    12 Apr 11 at 7:05 pm

  12. This is absolutely awesome! The automation of the URL shortening and the posting to FB is great. That is exactly what I used this for.

    This would be even better if you could save it in HTML format and keep a little formatting and even links. I know that goes into more of a blog concept. I don’t have any web hosting right now and would normally post something like this on my WordPress blog.


    Savvy Steve

    13 Apr 11 at 10:35 pm

  13. Glad that you like it. HTML is disabled by design to prevent abuse. One of my goals for this site is to keep it simple.


    14 Apr 11 at 9:42 am

  14. Great idea, great execution!


    10 Jun 11 at 4:22 am

  15. Thanks!!! Great resourse!! Please keep it up I’ll be using it often!!


    11 Jan 12 at 11:28 pm

  16. Hi, I’m new to facebook and your app. I just try it with long useless text to see how it works, but I couldn’t find a way to remove the posted text from your site which was unexpected.

    Once posted, is there any means for those who post to edit or delete the text from the internet. I know I can stop sharing the link but the text is still on your website and available to search engines and those who bookmarked the link?


    26 Jan 13 at 2:58 am

  17. Write to abuse email with the link to the text you want to delete and the reason why you want to do it and I’ll delete it. There is no other way.


    28 Jan 13 at 10:59 am

  18. SOLID. Two thumbs up for you Man.


    29 Apr 13 at 10:31 am

  19. I am trying to post a COMMENT on someone’s post and I think FB isn’t allowing it because it is “too long.”
    Can’t your app do that? I don’t see how.


    7 Sep 13 at 9:36 pm

  20. This is simple text hoster. So if you want to use it to post a comment then after submitting your text instead of sharing it on FB just copy the link (no matter full or the shortened one) and paste it to the comment on FB. It’ll work this way. However you may not find it very convenient for this purpose.


    9 Sep 13 at 3:51 pm

  21. Peter … What a great little useful application you have created. Moreover, I sincerely applaud and commend you in providing this fantastic public service for free. Your on-line application is simple and easy to use that a child could even use it Again Peter, “thank you” for this wonderful service. (Two Thumps Up!).


    26 Mar 14 at 5:54 am

  22. Can the story include pictures?


    6 May 14 at 6:08 pm

  23. Unfortunately not and I don’t expect it in the future.


    26 May 14 at 1:29 pm

Leave a Reply