Allow me to introduce you to my new little app, Postable
I absolutely hate having to switch all the “< " and ">” signs in my code to “<” and “>”, respectively. I also hate having to write “&” anytime I want to include an ampersand. This makes including code snippets on my blog and whatnot extremely annoying, and today I finally got fed up.
So, I threw together Postable, a little app that will do all that for you. Just paste your code in there, hit the button…and walla. Post-friendly code.
So try it out, let me know what you think, bookmark it, send it to all your friends, send me money… You get the picture. (Just kidding about that last one, by the way…Well, sort of.) 












Thank god somebody finally made this, I had even considered making my own for a while, as this is a problem that thoroughly annows me, but you beat me to it. anyway, thanks for a fine tool. btw, nice web 2.0 layout ;-P
I couldn’t believe that nobody had done it before, or at least that I hadn’t seen it. I did some googling, but couldn’t find anything.
And yeah, I’ll admit, I did sort of do the whole “web 2.0 design,” though I wasn’t really going to say that…
Very handy! Instant bookmark.
I used to open up a WYSIWYG editor, pasting the code, then copying the HTML, which includes the HTML entities already. But this definitely beats that. Very nice job.
Bug #1
Well what kind of app would it be if it didn’t have it’s share of bugs?
I’ll have to look into this…
OK, an update on that…
It will only accept a little over 5000 characters at once, but seriously, who the heck blogs over 5000 characters of code? If you’ve got that much, give them a zip file or something…
Um, why isn’t this AJAX-powered?
Good stuff – thanks!
By the by, does this script just run the form submission through PHP’s htmlentities() function and return it, or are you also parsing out something else it doesn’t handle well?
Nathan,
It runs it through htmlentities() then runs it through a str_replace() to again change ampersands to &, that way all the entities will show in the textbox rather than just execute.
Good job, man. I’ll bookmark it.
Just got around to using this app. Very Nice! I’ve bookmarked it and expect it to be getting a lot of use in the very near future. Great work!
If you ajax the form to server via POST instead of GET, I believe you will not encounter this error.
My 2 ¢
Aplicación para “formatear” el código para incluirlo en una página web…
Elliot Swan ha aprovechado bien su tiempo, y nos lo puede ahorrar a los demás, con una sencilla pero muy útil herramienta: postable.
¿Y cuál es el objetivo de esta herramienta? Facilitarnos la tarea de insertar código XHTML de ejemplo en una pág……
nice site! master
It can’t handle
php info();
or at least not when i type it in
That’s because there’s nothing in “php info();” that needs to be converted.
Now if you did “<?php info(); ?>” it would do some converting.
well i know that i was just testing out your app, trying the
when typing the php info(); in 1 word the postable makes an error and so does this blog so i guess it’s something to do with your host or something.
What’s the error that you get?
When I type in “<?php info(); ?>” I get “<?php info(); ?>”–Which is exactly what should happen.
well write:
the command “php info();” this should be in 1 word like phpinfo
wrap some php tags around it if you want to.
look it up on php.net can’t seem to post the right commant get some weird error, think it’s because of your host at it is also preventing me from writing it on this site too.
Ah, I see what you mean now. Yeah, it’s probably a dreamhost thing, trying to keep the server secure I’m guessing.
You know what would be cool? To find a javascript equivalent of htmlentities() and roll this little app into a Konfabulator/OSX compatible widget. I would love to give it a shot, let me know if you are interested.
I think this can be achieved using javascript alone. I’m building a javascript version of Postable. I’ll add another comment when done.
It could probably be done with a series of reg expressions, but you’ll have to go through and find all the HTML entities for everything you’re going to want to transform–I just used htmlentities() then a quick str_replace() to fix ampersands. When you do it that way, all the html entities will be replaced without tons and tons of code.
Is there really any reason to have a pure JavaScript version?
There’s no good reason to have a pure Javascript version on the web, but it could be good for making a desktop widget. I was actually thinking of making something similar for just that reason, but never got around to it.
Yeah, that’s true. From his comment, it sounded like it was for online use…maybe I read it wrong.
I made one. I haven’t tested Safari.
HTML Escaper and Javascript String Escaper
I have no exprience with desktop widget programming. But if somebody want to make a widget, she or he can copy and modify existing code if its license allows.
I wanted to write a javascript function that could take as input an element’s id and spit out a code block below the element automatically, so it would make my documentation easier, anyone seen something like it I can use?
IE innerHTML looks like hell (ruins my beautiful XHTML!)
Firefox innerHTML looks great, but I want a cross-browser solution
Elliot,
I have used this many times before. just recently I have found it again, and writing some code I’m doing it’s been invaluable.
Many thanks.
-Alan
“but you’ll have to go through and find all the HTML entities for everything you’re going to want to transform”
php.net: get_html_translation_table
get_html_translation_table() will return the translation table that is used internally for htmlspecialchars() and htmlentities().
rockin’ stuff!
thnx
Great !! Thanks!
Nice idea mate, I have my own version of this up and running too. ( HTML Friendly )
—
Dale Hay
Write a comment here.
Write a comment here. Thank you
[...] The developer of the tool, Elliot Swan, has spelt out everything in his announcement post. The name, “Postable”, is written in large letters (sans reflection). There is a code box, and a simple button named “make it friendly” below. It is AJAXed, which saves you a reload of the page. I tested it on a slow connection, and it managed to load quite fast. The scripts working behind the screen are Prototype and Scriptaculous JS library, along with a custom script. [...]
[...] The purpose behind Postable is to help you when you are posting code either on your blog or in a comments field. [...]
[...] Have you ever wanted to put code into a post without it being interpreted as code? A while ago I was trying to write a page to include code for buttons for my blog. After much struggling with the WYSIWYG editor I eventually managed to write it. If only I had seen this post from Elliot Swan ‘Allow me to introduce you to my new little app Postable’ then it would have been much easier! [...]
Hey, it’s this post’s two year anniversary! Anyway, I’m not sure if you’re still updating Postable or not, but I’ve noticed it seems to strip out the ‘+’ symbol. Other than that, I love it and use it often!
Great little app – saves so much time and there is no need for installing any of the various plug ins available. I do tutorials from time to time on My Site and this is going to help me do things a lot lot quicker! Thanks!
John
Hey all – I just went live with yet another one. The major differences are that mine is implemented completely with regex on the client side (and therefore super fast) and it also provides several different options to customize the output. I’ve been using Postable for awhile, and it’s great – but I ultimately needed a little more flexibility. Let me know what you think!
Asciible
Elliot, very good tool! Thanks
Write a comment here.Those funny ‘amp’ things are, I think, the worst of the lot – I don’t know whose stupid idea was to use that for the “&” sign and what’s so special about “&” that you can’t just have it come out the way it is. It is, after all, an actual key on the keyboard – unlike letters with cups on them or anything like that. So, I also can’t believe no one has done this before, and I can’t believe why it’s even necessary bit I guess that’s just one of those things.
You are awesome! Thank you!!
Awesome. I have another program I am looking for… is there a WYSIWYG online editor that does not produced tons of empty font tags and empty span tags and empty div tags etc. Is there one out there or do I need to write one?
See my example code below:
<P></A><A href="test.php?ul=1&id=ed98cd21-5e66-4a90-9126-3ca5c56d65ef"></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT>
</STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FON
T></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FON
T></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STR
ONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></S
PAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></F
ONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG><
/FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN><
/FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT><
/STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT
></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT
></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRO
NG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SP
AN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FO
NT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></
FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></
FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></
STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></STRONG></FONT></SPAN></FONT></FONT></A></STRONG></FONT></STRONG></FONT></SPAN></FONT></FONT></P/>
Postable is a life-saver! I couldn’t figure out how to get my template codes around Blogger’s careful eye for the longest time. But I found your Postable application tonight and will definitely be using it in the future. : )
Debbie
Awesome.
Awesome script, extremely useful.
Hello!
Very Interesting post! Thank you for such interesting resource!
PS: Sorry for my bad english, I’v just started to learn this language
See you!
Your, Raiul Baztepo
Все-таки, подобное не всем интересно. Хотя, каждому свое.
Awesome tool!
I used it this evening in a post and gave you credit:
http://www.ecomeg.com/2009/09/technomeg-how-to-add-grab-my-botton.html
WebMastack.ru – .
: , , , . . . . PHP, Java Script
Хай… Есть вопрос: как вы сайт раскручивали? В google везде наверху, я тоже хочу так!
I just got bitten by a bug here, Postable simply removes ‘+’ characters. This was previously reported by Jeremy Martin in March, 2008.
Any chance you might fix it someday??
It’s a pretty impressive idea of removing all unwanted symbols with html equivalent.
This application is valid only for text.
An improvement would be if the app identified those symbols( “) in HTML code. Then this would definitely become a tool which every web developer would want to use.
POWER! This is it!
Hey This is a simple but great tool. This is what genius is.
Hello,
It would be nice to have an option to replace white space with
it would allow to keep the indentation.
Thanks
[...] “I absolutely hate having to switch all the “< ” and “>” signs in my code to “<” and “>”, respectively. I also hate having to write “&” anytime I want to include an ampersand. This makes including code snippets on my blog and whatnot extremely annoying, and today I finally got fed up.” Created by Elliot Swan. [...]
[...] “I absolutely hate having to switch all the “< ” and “>” signs in my code to “<” and “>”, respectively. I also hate having to write “&” anytime I want to include an ampersand. This makes including code snippets on my blog and whatnot extremely annoying, and today I finally got fed up.” Created by Elliot Swan. [...]
Hi !
Maybe I missed a thing but I just can’t find the « button » to get my code change…
Thank you !
Djief
[...] “I absolutely hate having to switch all the “< ” and “>” signs in my code to “<” and “>”, respectively. I also hate having to write “&” anytime I want to include an ampersand. This makes including code snippets on my blog and whatnot extremely annoying, and today I finally got fed up.” Created by Elliot Swan. [...]
good work
“Voila”, not “walla”.
Отзыв об обучении в Школе своего Дела (ШСД) Юрия Мороза.ШСД помогает тем кто хочет идти вперед в своем развитии Это к Морозу, а если ищешь чего-то что за тебя сделает тебе хорошо то это к старику Хоттабычу!
Good morning!! If you want to buy the best software for Mac and PC, you to us we have all new program and only at low prices! All programs with a license! Come on Sale software online Mac and PC Sale software for Mac and PcSoftware saleOnline sale software for Mac and PCDownloads super software for Mac and PC.
[...] “I absolutely hate having to switch all the “< ” and “>” signs in my code to “<” and “>”, respectively. I also hate having to write “&” anytime I want to include an ampersand. This makes including code snippets on my blog and whatnot extremely annoying, and today I finally got fed up.” Created by Elliot Swan. [...]
So Useful! Thank u!
gmm great work but should i really call it an app?? no offence but hypothetically speaking an app is suppose to have more than just htmlentities and str_replace..
http://imgwebsearch.com/37461/img690408/online%20casino/1_gambling2.png
http://imgwebsearch.com/37461/img690408/online%20casino/2_gambling2.png
http://imgwebsearch.com/37461/img690408/online%20casino/3_gambling2.png
baldini’s casino sparks nevada casino rentals tulsa ok bel tera casino indiana expekt onlinefreeroll casino onlineslots career casino online welcome vegas regal casino twitter video poker casino gambling mn native american casinos skill onlinecasino skills casino green park casino alabama atlantis casino and resort pa racetrack casino new fun casino calgary rental grand casino in tunica trump marina casino resort casino hollywood hotel tunica free chip online casinos jeff black casino accounting southern california indian casinos casinos in snohomish county greg tolivar barona casino atlantic city casino reservations elvis casino council bluffs foxwood casino connecticut address bacaran bay biloxi casino casino kenny rama rogers best online casino promotion enter casino coupon code casino refrigeration and airconditioning hyatt casino palm springs cal neva casino resort casino inc pc game potawatomi casino and bingo paridice casino peoria il car accident peppermill casino first jackpot flash casino casino software prices compared wisconsin alcohol free casinos casinos for us players oasis casino wendover nevada ceasar casino atlantic city isleta casino alb nm play or deal casino mel tillis riverside casino on line gambling casino horizon hotel ans casino casino boat in burnswick casinos online gambling canada seneca casino niagara falls no deposit requires casinos affiliate book casino sport casino entertainment booking agents old 07s winstar casino golden riviera online casino new frontier casino hotel casino abbas in czech casino niagara closing october casinos in binghamton ny on line rgt casinos online casino and betting