Posts tagged ‘eHow’

eHow Earnings Tracker Version 1.1.0 Available

Version 1.1.0 of the eHow Earnings Tracker is available on the downloads page.  Changes are as follows:

* Changed error message “This is not an eHow Earnings page!” to “The eHow Earnings Tracker must be run from your Article Library (the ‘Articles’ tab under ‘My Profile’)”
* Added “Update Earnings using Yesterday’s Date” menu option.  This is useful if you didn’t get a chance to run the Tracker yesterday but you know that the earnings haven’t yet updated today.
* Added “Average of X per day” for both earnings and views.  Note that this average is over the selected date range.

eHow Earnings Tracker Version 1.0.2 Available

Version 1.0.2 of the eHow Earnings Tracker is available on the downloads page. There’s only one change in this version:

* “Change from previous day” values now take deleted articles into account so there are no longer negative changes.

Installing and Running the eHow Earnings Tracker

To install the eHow Earnings Tracker, click on this link.  That will take you to the following page:

install1

Because the add-on hasn’t yet gone through the approval process to make it public, you need to check the box next to “Let me install this experimental add-on”.  That will enable the “Add to Firefox” button:

let me install

Click on “Add to Firefox” and you will be taken to the “please donate” page:

roadblock

Once again, click on the checkbox and then “Add to Firefox”.  That will take you to the end user license agreement:

license agreement

Click on “Accept and Install” and you will get the Software Installation dialog:

install dialog

Click on “Install Now” and the tracker will be installed.  After installation, you will be prompted to restart Firefox:

restart

Click on “Restart Firefox”.  After Firefox restarts, you should see a dialog box telling you that the tracker was installed:

add on has been installed

The eHow Earnings Tracker has now been installed, so close the dialog box show above and log onto your eHow account.  Go to “My Profile” and then click on the “Articles” tab:

ehow page

Now you can run the tracker by going to Tools – eHow Earnings Tracker – Update Earnings or by right-clicking somewhere on the page:

tracker menu

You should see the screen flash a few times as the tracker navigates through your article library.  When the tracker is finished, it will open a new window with your earnings data in it:

tracker run

eHow Earnings Tracker Version 1.0.1 Available

Version 1.0.1 of the eHow Earnings Tracker is available on the downloads page.  This version has all of the major functionality that I had planned.

Changes since 0.4.0:

*==> Version 1.0.1 (August 5, 2009)

* Fixed bug with Tracker not working if the Windows user name had an apostrophe in it

*==> Version 1.0.0 (August 3, 2009)

* Added ability to toggle table display between earnings and views

*==> Version 0.6.0 (August 2, 2009)

* Added column sorting
* View table still gone, will be coming back soon!

*==> Version 0.5.0 (July 30, 2009)

* Added ability to select a date range
* Views table is gone, will return next version

eHow Earnings Tracker Version 0.4.0 Available

Yet another version of the eHow Earnings Tracker has been uploaded to to the Firefox Addons site. Head over to the downloads page to get it.

Changes since 0.3.0:

*==> Version 0.4.0 (July 13, 2009)

* Added “Totals” and “Change from previous day” rows for earnings and views

*==> Version 0.3.1 (July 13, 2009)

* Fixed problem with URL parsing when users had dashes(-) in their name.

eHow Earnings Tracker Version 0.3.0 Available

Another version of the eHow Earnings Tracker has been uploaded to to the Firefox Addons site. Head over to the downloads page to get it.

Changes since Version 0.2.0:

*==> Version 0.3.0 (July 13, 2009)

* Added “Copy Earnings Data to Desktop” menu option
* Added Views to HTML report

*==> Version 0.2.3 (July 12, 2009)

* Additional logging
* Fixed issue with invalid XML characters getting stored as part of titles
* Added “Delete Earnings Data” menu option

*==> Version 0.2.2 (July 12, 2009)

* Fixed bug related to addition/removal of articles from the article library

*==> Version 0.2.1 (July 12, 2009)

* Added more error logging
* A backup earnings.xml file is now created on a successful update

eHow Earnings Tracker Version 0.2.0 Available

I just uploaded the latest version of the eHow Earnings Tracker to the Firefox Addons site. Head over to the downloads page to get it.

Changes since 0.1.1:

*==> Version 0.2.0 (July 12, 2009)

* eHow earnings report now opens in its own tab
* Added styling to $0.00 value fields so that they are italics with gray font
* Added eHow graphics & color scheme
* Added “View Last Update” which views the last HTML stats page rather than regenerating it from eHow article earnings pages
* Added error logging and menu item to copy log file to desktop

*==> Version 0.1.2 (July 9, 2009)

* Added CSS styling to HTML report

Once development work settles down I’ll write some more posts about the tracker and how to write Firefox Addons.

eHow Earnings Tracker : Initial Release (Version 0.1.1)

So, it’s done – the initial release of the eHow Earnings Tracker is available from the Mozilla Addons site.  Head on over to my downloads page for more details on obtaining the addon.  The tracker is currently classified as “experimental” which is just Mozilla’s way of saying that they haven’t reviewed it and placed their stamp of approval on it.  Apparently there are over 400 addons in the review queue so that won’t be happening any time soon :) .

I must say that overall, it was a very smooth process to get my addon hosted by Mozilla.  I just had to create an account, fill out a few fields, and upload the addon.  The hardest part was deciding which software license I wanted to release my code  under.  The legalese was overwhelming and I just picked the simplified BSD license.  I have no idea if it was the right choice or not.

The tracker is currently pretty barebones, but it is functional from the limited testing I did with it.  A few fellow eHow writers (Carol McKenzie, Dianne Cass, and knyc) were kind enough to volunteer their services in testing it out for a few days before I start broadcasting its availability to the eHow community.

What it Does

As I originally mentioned, eHow gives writers very limited earnings data.  Currently there is no way to writers to figure out which articles get income on a day to day basis without doing a whole lot of manual work.  The tracker collects data each time that it is run and keeps a history so that writers can see earnings increase over time on a per article basis.  Since earnings updates only occur at most once per day, the tracker keeps data on a per day basis.  This means that if the tracker is run multiple times during a single day, it only keeps the last set of data for that day.

Using the tracker is very easy.  Upon installation, it adds submenus to both the main Tools menu and the context menu.  The user simply needs to navigate to one of their article earnings pages and select the menu option “Update Earnings”.  The tracker will then read all of the earnings pages and generate an HTML report.  The HTML report is currently very barebones and ugly but the plan is to fix that up.

tracker context menueHow Earnings Tracker context menu

How it Works

The tracker works by first examining the URL of the web page that’s currently in the browser.  eHow has very specific URL formats for the earnings pages so the tracker can figure out whether or not it can be run.

Once it is run, the tracker examines the HTML of the page and extracts data based on HTML elements and CSS class names.  It can also figure out how to navigate to the other earnings pages by using the “Next” anchor link at the bottom of the page and gathers information off each page as it loads.

ehow earnings html structureHTML structure of the eHow article earnings pages

The tracker stores its data in an XML file in the Firefox profiles directory.  If you’re curious, you can track it down by looking in the same directory as the URL that appears in the HTML report after the tracker is run.  The file is called eHowEarningsTracker_17of26_earnings_[ehow user name].xml.

Caveats

The tracker requires Firefox 3.5 because I needed to use some functionality that only became available in 3.5.

The tracker can only collect data when it is explicitly run.  Since it can only read what’s in the rendered HTML pages, it can’t know anything that the user doesn’t see.  This means that if the tracker will never have data for days that it wasn’t run.

This tool is completely tied to eHow’s HTML code.  If eHow does anything to change the HTML layout of their earnings pages then the tracker will not be able to successfully read any more data until I update it to handle the new HTML layout.  However, all of the past collected data would still be there.

I have no idea how this thing is going to handle large amounts of data.  Some people have hundreds of articles and tracking earnings data over weeks and months is going to get big.

Upcoming Changes

There’s really only two things I need to work on at this point.  The first one is to do some serious work on the HTML report.  It needs some nice styling and I really want to add some functionality to it (such as being able to sort by column).

The other thing that I want to do is to provide a way to export/backup the data in CSV or XML format.

eHow Earnings Tracker : A New Direction

One of the major challenges with doing software development is that you need to be constantly evaluating the direction that you’re heading in with both the code and the end product.  You can’t just decide to do something and then put your head down and do it.  The landscape changes as you develop a product – you learn better ways to do things, roadblocks come up, and your vision of the end product (and code) becomes more refined and  clear.  If you don’t pay attention to these things as you go along then inevitably you’ll wind up miles away from where you should be in the end.

On the other hand, you can’t be changing direction with the wind either.  This is a trap that many programmers fall into.  If you don’t have a solid starting vision for the product or you constantly change the requirements for the product or how it is implemented then you’ll wind up with a big mess or, even worse, the product will never get finished.

The balancing act of changing things that need to be changed and not changing things too often is one of the things that makes software development as much like an art or craft as an engineering or science.  Complicating things further is the fact that what’s best to do for the product often conflicts with what’s easiest to do in the code.

I was working on the eHow Earnings Tracker last night when I had one of those “aha!” moments where I knew that I needed to change the direction I was heading in.

My original vision for the tracker was that it would automatically detect eHow earnings pages as the user browsed the web.  When an earnings page was detected, the tracker would read the current page of earnings, save them to a file, and compare them to the previous update.  The user would be able to see which articles had increases in earnings from update to update and they would have a history of earnings that could be exported.  This  seemed like it would be fairly straightforward to implement and would be a low friction solution for the user.

As I worked on the code, a number of implementation difficulties arose and it became apparent that there would be some usability issues with the end product.

Implementation difficulties (code):

  1. Firefox can have multiple tabs open at once which means that, in theory, multiple earnings pages could be loading at the same time.  Writing code to handle this sort of scenario is very difficult in a Javascript based environment.
  2. Due to the fact that the code is only parsing one page of articles at a time and the article order is not guaranteed, the code can’t just blindly read & write the entire contents of the current earnings file stored on disk.  Each time an earnings page is viewed, the file needs to be read in and then its data needs to be compared to the current page of earnings to see whether article entries need to be added or modified.
  3. The code would be executing every time an earnings page was viewed, even if it didn’t have to.

Usability issues:

  1. The user would have to manually click through each page of articles (which can get tedious since articles are only displayed 10 at a time).
  2. Since the code was only seeing one page of articles at a time, it would have no way to inform the users of any articles that were added or removed since the last update.

My “aha!” moment was in realizing that the better way to do this would be give the user an “Update Earnings” button that could be activated whenever they were on their earnings page.  That button will trigger the tool to automatically navigate through all of the users’ earnings pages collecting information.  At the end of the process, an HTML page can be displayed showing a summary of all the earnings data.  This fixes all of the implementation and usability issues in one shot.  It’s a rare case where I can simplify the code and improve the product at the same time.

How to Track eHow


Since I now have a Firefox plugin that will properly update the browser’s status bar with the URL of the web page being viewed, it’s time to write code that will specifically detect an eHow earnings page.  For those of you following along at home, take the code from the previous post and add the following function just after the updateStatusBar function :

var update = function()
{
    var host = Application.activeWindow.activeTab.uri.host;
    var path = Application.activeWindow.activeTab.uri.path;

    m_eHowMsg = ""

    if(host.search(/www.ehow.com/i) == 0)     
    {         
        // eHow earnings URLs are in the form "http://www.ehow.com/members/user-p#-articles.html" or  "http://www.ehow.com/members/user-articles.html"         
        var userAndPageNumPattern = new RegExp("\/members\/\(.+)-(.+)-articles.html");         
        var userAndPageNumResult = userAndPageNumPattern.exec(path);          
        var userPattern = new RegExp("\/members\/\(.+)-articles.html");         
        var userResult = userPattern.exec(path);          

        if(userAndPageNumResult && (userAndPageNumResult.length < 1))         
        {             
            m_eHowMsg = userAndPageNumResult[1];         
        }
        else if(userResult && (userResult.length &lt; 1))         
        {             
            m_eHowMsg = userResult[1];         
        }     
    }      
    updateStatusBar(m_eHowMsg);
}

This function looks for URLs that match eHow earnings pages and then updates the status bar with the eHow user name that it finds.  To hook this function up, just replace the calls to updateStatusBar in onTabSelect() and onTabLoad() with calls to update().

Now when we navigate to a URL that contains eHow article earnings data we see the username in the status bar (the status bar will be blank for other URLs):

ehow username in statusbar