How much have you spent on HobbyKing.com?

|tomsun
How much have you spent on HobbyKing.com?

For some odd reason more than half of my RC parts comes from HobbyKing. Depressing or not; that means their purchase history page has some useful information:

- How much money have they got from me over the years? is an obvious question.
They almost provide the answer, by presenting a list of all orders with the order totals displayed. But there is no grand total and when you have 10:s of orders over multiple pages, it starts getting tedious to summarize them manually.

- More than once I've found myself clicking through all orders, to look up which exact part I bought several years ago. Really useful that the data is there with links to the product pages and all, but the part where you click back and forth is really frustrating. Some way to export all the data into a giant text file would be neat, importable into a spreadsheet maybe...

The last few hours I sat down and hacked together some javascript to automate the first task. The latter one is left for another day (or as an exercise for the reader perhaps ;-) )


Here is how you can figure out what you've spent on HobbyKing.com yourself, in 6 simple steps:

1. Start Mozilla Firefox
(Google Chrome supposedly have limited Greasemonkey support too, I haven't verified that) 


2. Install the Greasemonkey extension
...by clicking the "Add to Firefox" button

This is a tool that lets you augment your favorite sites with small snippets of JavaScript code that you yourself - not the site owner - has control over. It can be neat way to work around situations when the brains behind some website doesn't want to implement a small feature that you need, that would be easy to do but doesn't fit their vision or schedule. A drawback is that such scripts can be quite fragile: if the site owner changes their code they might step all over your scripts's assumptions. I.e. if you rely on this kind of hacks, be prepared that many of them will break / need additional tweaking over time. A library of Greasemonkey scripts can be found at userscripts.org

 

 

3. Install my Greasemonkey script hobbyking.purchased.user.js

The easiest way is to click "install" in the top right corner on its page on userscripts.org.

Alternatively, get it straight from my GitHub repository and drop it into Firefox manually.

 

4. Head over to HobbyKing.com and log in.

 

5. Click over to the order history page

There is a link on the customer page ("Orders: xx CHECK") and another in the footer ("Order Status").

 

6. "Total amount: calculate" above the list, is the new functionality we just added.

Click "calculate" and wait a few seconds while the script goes through all pages.

If that text doesn't show up then verify via  "Tools" > "Add-ons" > "User Scripts" that you performed steps 2 and 3 correctly. (If some time has passed since this article was written, that could alternatively be a symptom of that HobbyKing has changed that page in an unfortunate way since I last tested the script)

 

7. Voilá!

  

 

8. If you don't want to use the script anymore, it is easily removable via "Tools" > "Add-ons" in Firefox's menu bar. Click the "User Scripts" tab to the left and you get the option to disable or remove our script "hobbyking.purchased". The Greasemonkey plugin itself can be managed via the "Extensions" tab next to it.

 

No promises on future expansion or maintenance, but feel free to send feedback, fork it and / or submit pull requests over on GitHub.

0 comments

Leave a comment

Please note, comments need to be approved before they are published.

Have a story to share?

Share your builds, flying experiences and tips with the Flite Test community.

Write For Us →