Blogger v1.2

This is a tool that I developed as part of my work on this website.  I have been slowly revising this website over time.  Well, as I've reached version 4.0 right now, I decided to automate another process - the blog entries.  I wanted to have a nice little dialog-based windows app to type in some random thoughts and then have it automatically add it to the html page for me.  Well, not only that, but why not have it generate an RSS feed at the same time?  I knew it wasn't going to be technically very difficult; it was just the question of how long it would take.

Now this is a problem that has been solved a number of times on the web, most of the time it has been done with the use of form pages connected to backend database.  Well, this is all good and fine - and most of the solutions I've seen used in forums are very good.  In fact, I patterned this solution after them. :)  But what happens when you move your web site all over the place, hopping from server to server like I've been doing over the last few years?  Unfortunately, you won't always have a good/recent/compatible implementation of mySQL or the like loaded on your webserver of choice. I have also had the mis-fortune of the webserver owner switching from one OS to another underneath me and database software was not even loaded on the new platform.  I started out by hooking to some of the server's niceties with my code at first, but after everything broke when moving it; I quickly learned a painful lesson.  You sometimes simply won't have any of those nice back-end apps and you end up re-thinking or re-writing massive portions of your site.  Another joy is when your customized data sorting/formatting code blows up over on the latest Opera, Tiger, Firefox, Mozilla, IE, incompatibility. 


Sample of my web site's automatically generate blog.

One of the design goals for my latest web site (since about it's second to third version) was to be 100% portable by just dragging and dropping the whole shebang onto any server - be it MS, Apple, or Linux based.  That pretty much limited me to Java scripting for most of the work; which wasn't a problem.  For all the heavy lifting, I just do all the work locally on my hard drive.  I find it is far less error prone and there is no porting or browser incompatibility problems that has caused many a web site designer to pull their hair out and jump out windows.  As in most design, just keep it as simple as possible and life gets a LOT easier.  I've already created some nifty automated tools for generating my photo journal pages, and they work really great and effortlessly.  Just drop all the images you want into a directory and press GO on the little apps and about 10 minutes of grinding later you have images, html, and thumbnails generated.  That code is FAR too messy to publish right now, but this tool isn't.  So, without further ado, I present the Blogger:
 

Features:

  • Type in all the text you want, embed HTML or RSS code and so forth.  Press GO and it generates HTML and RSS feeds, or either one.  You select which ones you'd like to generate.

  • Inserts article at the top of both the HTML and RSS feeds.  Keeps your old entries and moves them down.  For RSS feeds, it keeps only the last 10 articles, HTML is unlimited.

  • Automatic date/time stamping using the local time (or shut it off and enter your own date/time to post-date entries)

  • 2 temporary save slots so you can work on an entry, save them  temporarily, then come back to it later to finish and publish it.

  • Auto-scanning validity of RSS feeds.  RSS feeds die if you try to put the characters: <, &, and a few others.  Blogger will automatically scan the input and generate the appropriate escape sequences so that they appear correctly in the output feed.

  • User specifiable filenames

  • Some handy hot-buttons to automatically enter italic, bold, paragraph markers, or underline codes.  You could of course do this by hand, but it's also nice just to click a button to get the generated codes

  • An icon stolen and re-tooled from Blogger.com :)

Screenshots:

Program running HTML it generated RSS feed it generated Sample of many articles appended by Blogger

Download:

You can download a zip file with the code [here].  Please note that this is still pretty much beta software right now; it's provided for your enjoyment.  Let me know if you have suggestions; I'm currently contemplating a lot of different directions to go with this proof-of-concept...

 BLOGGER.ZIP    MD5 HASH: BF70D0F553FE43593A661D6C48B5BFE0 Size: 9,462 bytes

Future improvements:

  • Ability to add URL's internally to the text area (already possible in html, not RSS)

  • Ability to add pictures to the text area - specify size and positions (already possible in html, not RSS).

  • Ability to remove articles from your previous entries (aka:' whoops - didn't mean to publish that...')  Perhaps parse the feeds into a tree-display of past articles w/ selective removing?

  • Auto-archiving of really old items.  Each feed has a 'current' list which has like the last 10-20 entries, and then creates an archive feed/file  that holds everything older than that.  Perhaps even splits them into multiple files/feeds by year or sets of 50 articles each.

  • Verify/do some checking to make sure that all your open and close <XX> commands are actually closed.  RSS feeds barf if you leave anything open.  Perhaps verify some of the HTML code as well...

  • Yikes, clean up the edit box editing.  Perhaps change to an imbedded OLE object or link it up with Word/other word processing app so that you can get spell check and some actual formatting.

Version history:

v1.2
 - Whew - fixed a bunch of bugs - file size limitation bug, imbedded html in rss feed mis-translations, and a few others.  Still more to go though...

v1.1
 - added 2 temporary load/save slots

v1.0
 - Initial release
 

Source Code:

Not publicly available yet, but I'd be happy to send it if you email me.  I'm still working on this guy, and there is some code in there that I'd rather not let anybody see - because I'm ashamed to have written such sloppy stuff.  I'm cleaning it up as I go.  If you'd like,  I will send you a zip of the whole Visual C++ project if you'd like to compile your own, or rework the kind of HTML it generates for your own web page.  If you want to contribute any cashola, you can feel free to send a paypal payment at my gmail address and you'll be assured of a fast response and code sending. :)