Archive for the ‘Tools’ Category

Blogger date – tear-off desktop calendar format

Saturday, July 10th, 2010

There are a few of these on the web, here’s one more!

The code below uses JavaScript to replace date text on a HTML page, and the CSS code styles it in the format required. Blogger instructions provided. Blogger does not make it easy to do this – in fact, there are quite a few things missing that are necessary to make good use of blogger, for low-volume, friends-and-family type of blog sites.

Date may be displayed in two ways, as shown in the image: if the date text is of the format Sunday, June 27, 2010 then a block is created to make the date look like it is from a desktop calendar. Any other date format is displayed as is, in a rounded border box.

Unfortunately, it is not east to insert this in Blogger templates. It requires manual editing, so the usual disclaimers apply – keep a backup, and don’t do this unless you are comfortable with editing blogger templates.

Copy the JavaScript section to the head section in the blogger template. Copy the CSS section also to same place, or add it to the “Add CSS” button available under Advanced in the Blogger Template Designer.

Then, change the HTML that prints the date, the example below uses the timestamp (to show the date on every post, unlike the default blogger behavior which shows date only once, for all postings made on one date). Remove this line:
        <h2 class='date-header'><span><data:post.dateHeader/></span></h2>
Remove that line (and any surrounding enclosures that are not needed). Where appropriate, add:
        <span class='date-header'><script type='text/javascript'>calDate(&#39;<data:post.timestamp/>&#39;);</script></span>

For example, put that just before:
      <div class='post-outer'>
or after:
      <b:if cond='data:post.isDateStart'>

All the code as well a working HTML page is at this link: example code for desktop-calendar style date formatting. Visit that page, view the source, or save it locally and edit the colors, borders, sizes as needed for your purpose, and then upload the appropriate JavaScript and CSS code to your Blogger template.

Share

Import Prices Script for Quicken

Tuesday, March 10th, 2009

Quicken is a package that works pretty well, but the manufacturer has a tendency to periodically block functionality.

For example, right now Quicken 2006 will be unable to download updated prices starting in April 2009.

There is certainly no technical decision behind this – it is just a marketing push, so make people upgrade even if they do not desire to move to a new version.

Quicken does have a manual “Import Prices” command seen when viewing the Portfolio. Therefore, it is not too hard to write a script that will download current prices, and import them into Quicken.

It is a .WSF file, a Windows Shell Scripting program. It will work on Windows XP, and Vista and may work on Windows 7, and is available in source code form. The script looks up historical and current prices for a list of symbols, and stores the prices in the format Quicken needs. Optionally, it can automate the import of the prices in Quicken by using Windows automation SendKeys method.

Archive with script and readme: QImportP-0.5.0.zip

And here are links to look at the key files: QImportP.wsf, the README, and the ChangeLog.

Prices are looked up using the Yahoo Finance web site. Quicken manual import prices only accepts date and price for a symbol, it cannot import volume and other data.

The script does try to automate loading of the price data into Quicken, but the mechanism of using SendKeys is very fragile, it may not always work – keys may get to the wrong window, or at the wrong time.

Version 0.3 of this package added support for non-US users, based on the code given in a comment, the /dmy and /div100 options provide that support. From what has been reported elsewhere on the web, shares and mutual fund price downloads in UK are priced differently – shares in pence, funds in pounds (or vice-versa?). So QImportP provides the /div100 option which can be used when needed.

The QImportP package is placed into Public Domain.

Share