Category Archives: Tech


Import Prices – Quicken

Source code includes the script and command file for Microsoft Windows:
The link can be used to view individual files and download entire package.

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

For example, Quicken 2006 has been unable to download updated stock prices since April 2009. Quicken 2006 itself installs on even the latest Windows 10 (2016) just fine. [As an aside, it is just amazing that Windows 10 has kept compatibility alive for old software – Quicken 2006, as well as the SendKeys method used by the script below! Kudos to Microsoft!]

There is certainly no technical decision to disable automatic stock price updates – 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 has been tested to work on Windows XP, Windows Vista as well as Windows 10 (2016), and is available in source code form.

The script looks up 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.

Ticker symbols are used to lookup quotes. There are two ways of doing this:

1: Google Docs Spreadsheets can be used for current quotes using the GOOGLEFINANCE function, such as in this example spreadsheet.
This supports a wide range of ticker symbols from US and non-US exchanges, as well as currency exchange rates. It does not support historical quotes and the some of the ticker symbols such as mutual funds have stale quotes, up to 4 days old.
See the /gcsv: option to this script.

2: Alpha Vantage TIME_SERIES_DAILY API can be used to download current and historical prices. This supports US exchanges, see their website for details. Using this requires creating a personal key at their web site and then passing that key to your invocation of this QImportP script, see the /avkey: and /s: options.
This is a very slow interface. Unlike the Google Spreadsheets method which downloads entire spreadsheet and all symbols in one web lookup, Alpha Vantage API only supports one ticker symbol quote lookup per second for the TIME_SERIES_DAILY API call.

Both methods above can be used in a single invocation of QImportP. For example, current currency exchange rates and stock quotes are better handled by using Google Spreadsheets, while fresher prices for mutual funds are available using Alpha Vantage API.

2017: Yahoo and Google no longer supports historical or even just current price downloads.
So for historical data and yahoo quotes both don’t work anymore.
Google Finance web pages also do not work: or either.

The source code which includes the script and command file for Microsoft Windows is here:
The link can be used to view individual files and download entire package: QImportP latest .zip

Older versions: [2015-04-09] [2009] (Older version download may be disabled by Chrome. Use Microsoft Edge browser, or use the source code link to browse older versions.)

The script automates loading of the price data into Quicken, but the mechanism of using SendKeys may be fragile, though in practice it usually works.

Version 0.3 of this package added support for non-US users, based on the code given in a comment (#5535), 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.
More recent versions of QImportP support downloading from a Google Docs Spreadsheet, which allows for doing any arithmetic on the quotes so there may not a need to use /div option anymore.

The QImportP package is placed into Public Domain.

[The original post with all old comments here: Archived Import Prices Script – 2009-2013]

Sony TV Remote

Recent Sony Bravia TVs offer a web based control mechanism which can be used to control the TV.

Here’s some code that provides a web page with buttons that activate functions on the TV.

It allows for custom button creation and for quick access to specific channel numbers.
And since it is just a web page (HTML with Javascript), it works on computers, smartphones,
and tablets.

Here’s an online working version:
Online Sony TV Web Remote.
That page also has the Help tab with more information:
Note that the link above is actually a working example, and it will work if you are accessing the page from a computer which can also access your TV. So visiting the page from your home network that has both the computer (or smartphone or tablet) and the TV visible to each other will allow you to control your TV from the link above!

Another way to use this package is to download it locally and then visit the sony-tv-html page in Firefox or Chrome (it does not work in Microsoft Edge).

The Help tab on the Online Sony TV Web Remote has more details on various ways to download and install the package.
It can also be installed as web extension, though that may not be necessary and may be more complicated than just unpacking the source and browsing to the local web page: file:///.../sony-tv.html URL and see if it works.

Source Code
GitHub sony-tv-remote link can be used to browse all source files including the README with more details.

Download the code as a ZIP archive:

(This has only been tested on Firefox and Chrome. It does not work on Microsoft Edge which does not support the standard Javascript code used here.)

Using this requires the TV to support IRCC control (Sony Bravia TV IR-like-control-commands), have a fixed IP address, and allow remote access using a pre-shared key. TV should also support CORS (cross-origin resource sharing) to avoid Javascript same-origin policy issues. Most (all?) Sony Bravia TVs in 2016 seem to provide this support.

Screenshots of Version 1.2 (Jan 2017) on the desktop and on an Android phone:

While it is simpler and easier to use this as a normal web page, it can be used as a web extension too.
It can be manually downloaded by right-clicking this link: Firefox Add-on Sony TV Web Page Remote.
Then use the Firefox Menu -> Add-ons -> [Settings Gear Icon] -> Install Add-on From File to load the extension.
Once the extension is loaded, it will show up as an television icon on the browser toolbar.
Clicking on the extension brings up the web page with the remote control buttons.

Drupal to WordPress

This site is now using WordPress and no longer using the old Drupal 6 system.

It was not an easy process to maintain the old content! Took many iterations, trying it out a couple of times a year starting in 2014!
Creating a static drupal site.

Then in WordPress, created a plugin to customize the plugins being used and for general WordPress customization.
For example: hook into WP action to trap all 404s.
add_action('wp', 'redirect_all_404s');
This was preferable to a .htaccess redirect since I wanted to first have WordPress check whether it had a link and then look into checking if the link was a file in the archived Drupal subfolder.

It is all done now, so migration is finally complete in December 2016.