Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I'm interested in seeing my reputation graphed as points earned per day/week/month rather than the cumulative graph you get on your profile.

Is there an existing app for that or is it something I'd have to build myself?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

If you don't mind doing this interactively, you could simply get your rep dump and parse it out.

This is obviously keyed to your cookie, so, as i said, it would have to be an interactive process.


Caveat: this code will do what you want, but I don't think the data coming from the api is usable right now....

You certainly could use the api to do something like this but in order to get the data in a form that will give you the points you want your min/max window would have to be from 1970 to 2050.

Except for the most obscenely reputed users this should not be an issue.

Here is a JavaScript example of grouping by day (because it is easy), using Soapi.JS2. This code has been included in the quickstart example, and since Soapi.JS2 is in alpha, you may want to refer to that latest code. I will update this answer when Soapi.JS2 goes beta.

var context = new Soapi.ApiContext(apiKey);

context.initialize(function() {
    context.official.stackApps.users().byId(14).reputation()
    .fromdate("1/1/1970").todate("1/1/2040").pagesize(100).pagecount(0)
    .invoke(function(items) { // items = collection of all your rep_change

        var output = data
        .GroupBy("Math.floor($.on_date.getTime() / 86400000) *86400000")
        .Select("new Date($.Key()) + '\\t' + $.Sum('$.positive_rep - $.negative_rep') + '\\n'")
        .ToString();

        alert(output);

    });
});

Same code, using scripted lamdas

var context = new Soapi.ApiContext(apiKey);

context.initialize(function() {
    context.official.stackApps.users().byId(14).reputation()
    .fromdate("1/1/1970").todate("1/1/2040").pagesize(100).pagecount(0)
    .invoke(function(items) { // items = collection of all your rep_change

        var output = items
        .GroupBy(function(item) {
            return Math.floor(item.on_date.getTime() / 86400000) * 86400000
        }).Select(function(group) {
            return new Date(group.Key()) + '\t' + group.Sum(function(item) {
                return item.positive_rep - item.negative_rep
            }) + '\n'
        }).ToString();

        alert(output);

    });
});

Generated Requests:

http://api.stackapps.com/1.0/users/14/reputation?fromdate=25200&todate=2209014000&pagesize=100&page=1&jsonp=Soapi._jsonp2
http://api.stackapps.com/1.0/users/14/reputation?fromdate=25200&todate=2209014000&pagesize=100&page=2&jsonp=Soapi._jsonp3
http://api.stackapps.com/1.0/users/14/reputation?fromdate=25200&todate=2209014000&pagesize=100&page=3&jsonp=Soapi._jsonp4

Output:

Wed Aug 18 17:00:00 MST 2010    10
Tue Aug 17 17:00:00 MST 2010    20
Mon Aug 16 17:00:00 MST 2010    50
Sun Aug 15 17:00:00 MST 2010    305
Fri Aug 13 17:00:00 MST 2010    30
Thu Aug 12 17:00:00 MST 2010    110
Wed Aug 11 17:00:00 MST 2010    420
Tue Aug 10 17:00:00 MST 2010    350
Mon Aug 9 17:00:00 MST 2010 70
Sun Aug 8 17:00:00 MST 2010 75
Fri Aug 6 17:00:00 MST 2010 90
Thu Aug 5 17:00:00 MST 2010 30
Tue Aug 3 17:00:00 MST 2010 22
Mon Aug 2 17:00:00 MST 2010 35
Sat Jul 31 17:00:00 MST 2010    100
Thu Jul 29 17:00:00 MST 2010    115
Wed Jul 28 17:00:00 MST 2010    123
Tue Jul 27 17:00:00 MST 2010    10
Sun Jul 25 17:00:00 MST 2010    265
Sat Jul 24 17:00:00 MST 2010    -195
Fri Jul 23 17:00:00 MST 2010    10
Thu Jul 22 17:00:00 MST 2010    70
Wed Jul 21 17:00:00 MST 2010    50
Mon Jul 19 17:00:00 MST 2010    50
Sat Jul 17 17:00:00 MST 2010    50
Thu Jul 15 17:00:00 MST 2010    110
Wed Jul 14 17:00:00 MST 2010    20
Tue Jul 13 17:00:00 MST 2010    10
Mon Jul 12 17:00:00 MST 2010    38
Sat Jul 10 17:00:00 MST 2010    40
Thu Jul 8 17:00:00 MST 2010 40
Wed Jul 7 17:00:00 MST 2010 10
Tue Jul 6 17:00:00 MST 2010 173
Mon Jul 5 17:00:00 MST 2010 50
Sun Jul 4 17:00:00 MST 2010 50
Sat Jul 3 17:00:00 MST 2010 40
Fri Jul 2 17:00:00 MST 2010 10
Thu Jul 1 17:00:00 MST 2010 200
Wed Jun 30 17:00:00 MST 2010    130
Tue Jun 29 17:00:00 MST 2010    40
Mon Jun 28 17:00:00 MST 2010    70
Sun Jun 27 17:00:00 MST 2010    40
Sat Jun 26 17:00:00 MST 2010    40
Thu Jun 24 17:00:00 MST 2010    10
Tue Jun 22 17:00:00 MST 2010    55
Mon Jun 21 17:00:00 MST 2010    10
Sun Jun 20 17:00:00 MST 2010    70
Sat Jun 19 17:00:00 MST 2010    18
Fri Jun 18 17:00:00 MST 2010    30
Thu Jun 17 17:00:00 MST 2010    175
Wed Jun 16 17:00:00 MST 2010    60
Tue Jun 15 17:00:00 MST 2010    90
Mon Jun 14 17:00:00 MST 2010    60
Sun Jun 13 17:00:00 MST 2010    10
Sat Jun 12 17:00:00 MST 2010    20
Fri Jun 11 17:00:00 MST 2010    20
Sun Jun 6 17:00:00 MST 2010 10
Sat Jun 5 17:00:00 MST 2010 55
Tue Jun 1 17:00:00 MST 2010 45
Mon May 31 17:00:00 MST 2010    30
Sun May 30 17:00:00 MST 2010    10
share|improve this answer
    
Cheers - I was quite prepared to do it myself ;) –  ChrisF Aug 19 '10 at 13:59
1  
@chris - no problem. I need use cases for examples. a good way to design libraries is to use them.. i get so wrapped up in the implementation that usage can suffer. it is these sorts of exercises that help shape my offerings ;-) –  Sky Sanders Aug 19 '10 at 20:34

Of course now the users pages are sortable by weekly, monthly, quarterly and yearly rep as well as all time rep.

There is no need for any extra application/script any more.

share|improve this answer

You must log in to answer this question.

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