The Codificator now provides: - automatic code wrapping in DC board format - conversion of regular HTML-formatted text to DC board formatted text - link extraction from HTML to DC board format - auto fetch of webpages, with on-select conversion of content to DC board format.
It won't boil your coffee or knit you a warm sweater for the winter, but it may help you to be more efficient when you're online discussing politics.
The online version w/tools I rewrote the main form this week to fix a Firefox bug, and also included some tools to convert HTML to DC-board format. To use this form: As you write, you can use the buttons to insert code to the form, and also wrap marked text with code.
The Preview is a window transforming the DC-code back to html to enable you to see how your post is coming on. When you're done, click Select text, then copy and paste it into the board where you are debating. The actual use should be easy enough to understand as this is very much like similar routines used in phpBB and other board systems.
It is tested in IE and Mozilla Firefox for Windows, let me know if you use it in other browsers and how it works.
Here's a screenshot of the main form in my FF browser.
Pasted HTML text converted to DC board formatted text. The conversion is performed automatically by clicking the Generate DCcode button. One may choose whether the code is line separated by the BR-tag or by linefeed.
Pasted HTML text - link extraction. This is performed by clicking the Extract links button. This extract all links from the HTML coded text and makes a list of clean links.
Pasted HTML text - link extraction. This does the same as the above, but provides the links with link text.
There is also a function for returning the post as pure text, but this will probably not revolutionize the internets as this is what you get when you copy the text straight from the web page anyway.
The Fetch and Convert tool
OK, so I wanted some deeper codification challenges and this was it. Was is possible to actually fetch a web page by PHP, select the text with your mouse and then process the selected HTML code to DC board code? As it turned out, it was.
Here's the routine explained, I've used the same article as in the example above.
Step one: Paste the url into the url-field and click Fetch content. It will appear as escaped HTML-code in the layer right below the field. The PHP-script used to fetch the web page strips all html-tags except links, bold and italic. In the next step, the code becomes visible.
Step two: Click Make HTML to convert the code to readable format. You now need to scroll down to find the part you want to process.
Step three: Mark the text you want to convert to DC board code. You should note that you must mark 15 chars of clean text at the top and bottom of your selection. That means: no links, bold/italic tags or linebreaks must be among the first 15 and the last 15 chars if the selection is gonna be successful. When you've marked the text you want, click Process selected to go to step four.
Step four: The DC formatted code is generated. You can now process the text as in the previous tool; DC coded text, extract links and so forth. Your selections stays in a hidden field, so you can test several without reselecting. If you do need to reselect, there's no need to fetch the page again; just click Restore page to put the original fetched content into the select area. When you're done, clean the DC code for any residues you don't want, click Select below the DC code area and copy the text into the main form.
All in all some useful tools for the savvy debater. I might write some more tools later, and will probably update the Fetch and Convert tool as time goes by. Please let me know if you discover any bugs.
UPDATE: I have updated the Fetch and Convert tool with a new function that allows for converting all fetched code to DC code. That means this tool will have an additional button to the buttons shown in the screen shots.
The Codificator in xPresso. Much the same, but it does produce html, not DC code, and has some additional functions.
The DC Forum software is in use at several political forum sites, most notably the Democratic Underground (DU), where I hang out for my daily political fix. Hence the name of this tool; the DU-o-matic Codificator ;-)
Large number of US citizens demonstrated against the war in Iraq (and the possible war in Iran) during this October weekend. Massive turnout in Boston and San Fransisco, and also in Chicago, LA and DC people took to the streets. The message was: NO more war in Iraq! NO to a war with Iran!