18

When evaluating how well a given Area 51 site in public beta is doing, it's helpful to compare to other Area 51 sites that have launched. I think a useful metric to see would be how long each site that has now launched was in beta for prior to launch. This should be trivial to add:

Proposed screenshot with FHC FTW

This would be a very useful metric to see, I think.

8
  • I like how the screenshot depicts the UX proposal. Feb 12, 2012 at 17:40
  • @BoltClock'saUnicorn I suggested it because one of my site's users lamented UX being in beta for way too long, and I don't want my site to be in beta nearly that long Feb 12, 2012 at 17:46
  • IT does show "private beta start" but it's only accurate to the year in this case, missing like 40% of the time the site was in beta.
    – Ben Brocka
    Feb 12, 2012 at 18:30
  • @BenBrocka Well, it does have a datestamp tooltip like other times on the site (although the launched date is lacking said tooltip)
    – Tim Stone
    Feb 12, 2012 at 18:38
  • @TimStone if I have to do math, the unicorn will not eat the waffle! Feb 12, 2012 at 19:54
  • 4
    It is well established that unicorns do not enjoy math.
    – Ben Brocka
    Feb 13, 2012 at 0:49
  • So since it didn't get 10 upvotes and I answered the question does that mean I get to eat the Unicorn instead? Feb 14, 2012 at 16:55
  • @Josh'sSocks the question now has 10 upvotes thanks to your answer! So I'm going to update the picture with the unicorn eating you Feb 14, 2012 at 17:09

1 Answer 1

4

Okay, I was a bit too quick to criticize you before. The Area 51 page doesn't contain the date the site launched... but my friend Tim Stone reminded me that the API does provide this information. So I continue to assert that you being a JavaScript developer as your primary profession and still needing to ask the community to do this for you means you're totally pathetic.

I updated my code, it now uses the API to fetch the site's launch date and then adds a "public beta duration" heading to the Area51 page. I've made it available as a userscript and The Unhandled Exception listed it on StackApps. Here's a screenshot:

Now accurate!

Here's the code to do this:

var mySiteInfoUrl = 'https://api.stackexchange.com/2.0/info?filter=!)5788xVOwy(eXAQATQD*PIQMmK-z&callback=SoTimeMahBetaSiteInfoCallback&site=';

window.SoTimeMahBetaSiteInfoCallback = function SoTimeMahBetaSiteInfoCallback(data) {
    //console.log("SoTimeMahBetaSiteInfoCallback got ",data);
    var publicBetaStart = publicBetaStartLabel.next().find("span").attr('title');
    var publicBetaStartDate = new Date(publicBetaStart);

    if(data.items[0] && data.items[0].site.launch_date) {
        var siteLaunchDate = new Date(1970,0,1);
        siteLaunchDate.setSeconds(parseInt(data.items[0].site.launch_date));

        var publicBetaDuration = (siteLaunchDate - publicBetaStartDate)/1000;

        publicBetaStartLabel.before('<p class="label-key">public beta duration</p><p class="label-value">'+secondsToDuration(publicBetaDuration)+'</p>');
    }
}

function getSiteInfo(site) {
    $(document.head).append('<script src="'+mySiteInfoUrl+site+'"></script>');
}

/**
 * Converts seconds to an english date ("3 days, 4 hours, 5 minuts, 6 seconds")
 *
 * @see http://stackoverflow.com/a/818945/75801
 **/
function secondsToDuration(seconds) {
    var tbl = [
        [ 365*24*60*60, 'year' ],
        [ 7*24*60*60, 'week' ],
        [ 24*60*60, 'day' ],
        [ 60*60, 'hour' ],
        [ 60, 'minute' ],
        [ 1, 'second' ]
    ];

    var t = parseInt(seconds), r = '', tblLength = tbl.length, i, u;

    for (i = 0; i < tblLength; i++) {
        var d = tbl[i];
        if (d[0] < t) {
            u = Math.floor(t / d[0]);
            t -= u * d[0];
            r += u + ' ' + d[1] + (u == 1 ? ' ' : 's ');
        }
    }

    return r;
}

var publicBetaStartLabel = $('p.label-key:contains(public beta start)');
if(publicBetaStartLabel.length) {
    var vistSiteNowLink = $('a.site-health-visit-link');

    if(vistSiteNowLink.length) {
        var siteName = vistSiteNowLink.attr('href').match(/http:\/\/([A-Za-z]+)\..*/)[1];
        getSiteInfo(siteName);
    }
}
5
  • Thanks to This StackOverflow answer, otherwise it would have taken me 3.2 minutes. Feb 14, 2012 at 16:54
  • 2
    -1 no microsecond count. :P
    – Ben Brocka
    Feb 14, 2012 at 16:57
  • 2
    -1 This is not the length of the private beta you stupid, stupid sock! This is how long ago the beta started. You need to rethink your algorithm. Feb 14, 2012 at 20:12
  • tsk tsk, having arguments with yourself
    – jcolebrand
    Feb 14, 2012 at 21:15
  • He's about to be washed again @jcolebrand Feb 14, 2012 at 21:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .