Matt Simner

GreaseMonkey Script to export ALL your My bubble stats to Excel in CSV format with a single click by Matt Simner

Posted on December 11, 2008

After playing with my original CSV exporter I couldn’t resist trying to improve it somewhat.

  1. UPDATE (14/05/2009) : Amended to cater for the new MyBubble layout – no visual changes
  2. UPDATE (26/03/2009) : Amended to cater for the new MyBubble page – now look down the right of the page for the little excel icon :)
  3. UPDATE (31/12/2008) : Fixed a bug and all my scripts now also available on UserScripts.org
  4. UPDATE (24/12/2008) : Now added RB work ‘ID’ and Page number (as requested by Jo).

The downside to the original script was that it required you to go onto each ‘works’ page (e.g. clothing p1, p2, art, writing etc) to get the stats for each.

This version (named slightly differently on purpose) works only on the My Bubble page, via a sneakily inserted ‘quick link’ called ‘Retrieve CSV Stats’. Just click the link and ‘hey presto’ (after a number of seconds) you should find a number of tables at the bottom of the page with all your current work statistics (clothing, art, writing, calendars, journal) in a semicolon-delimited format (commas are more likely to appear in work titles and screw everything up :) ).

The idea is that you simply copy the text and paste it directly into Excel – make sure you paste as Text (older versions need this to be explicitly done through ‘Paste Special’). It shouldn’t need too much ‘text to columns’ mucking around.

If you like the sound of this then:

Download it from UserScripts.

Some people have been very kind in reporting bugs from previous scripts so please post a comment if something goes drastically wrong…

PS: For those of a technical disposition it then basically does some rather long-hand processing and retrieves each mybubble works page behind the scenes (using JQuery AJAX), gathers up the stats and then spits them out into separate tables at the bottom of the screen. The tricky bit is grafting together potentially multiple pages of works into one list (something I’d love RB to support as a preference).

  • sepia

    sepia

    Hi Matt,

    This sounds promising. I tried it but got burned… The tables don’t show. I disabled all my other RB greasemonkey stuff and logged in to one of my other accounts that only has one page of art. Both options didn’t help. I had a look in the error console and found this error. I hope that helps in seeing what went wrong.
    Error: uncaught exception: [Exception… “Component returned failure code: 0×805e000a [nsIXMLHttpRequest.open]” nsresult: “0×805e000a (<unknown>)” location: “JS frame :: http://www.mattsimner.com/google/redbubble/jque... :: anonymous :: line 28” data: no]

  • geetwee

    geetwee

    By the way the Sepia comment is from my other account. Please reply to this account.
    Thanks.
    Jo

  • geetwee

    geetwee

    Works OK on one of my other computers. Unless you changed, something on the pc which was used for the first test isn’t working like it should.

  • Matt Simner:

    Thanks again for being my tester Jo! I have a number of other Firefox addons and Greasemonkey scripts installed on my machine at work – generally development-related and I find that some things (unknown at this stage) tend to not play well together.

    The error that you got appears to be in an external library (JQuery) which tends to suggest to me that something else is interfering with it.

    Do you get the error when you click the ‘Retrieve’ link? or does it not even show the link? (also I’ve got V3.0.5 of Firefox on Windows). If I can recreate the problem then I’ve got more chance of solving it. I’ll do some digging in the meantime.

    Thanks again.

  • geetwee

    geetwee

    I removed 5 of my Firefox add-ons and disabled other Greasemonkey scripts but that didn’t help. In the end I uninstalled Firefox version 3.0.5. and installed a fresh copy. After that your GreaseMonkey Script worked !!! I think it is very useful and it would be handy if RB itself provide for such page.
    Requests:
    1: If possible could you add an extra field with the page number of the image? I have 27 pages with photos. Using the stats I could decide to remove an image and jump directly to the right page. (I know page numbers start shifting when you start deleting)

    2: if possible could you add an extra field with the “RedBubble” ID? For example if you go to http://www.redbubble.com/people/geetwee/art/226...
    the part 2267072 is what I call the ID. If you have the ID you can use Excel to make links to the image or page itself. Handy to make stuff like this

  • Matt Simner:

    Wow – that’s dedication to the cause – sorry you had to reinstall Firefox. I can certainly look at adding the bits you requested. I was originally going to put the ID in, but didn’t spend the time working out exactly which bit of the URL was the ID. It may be after Christmas now, but I’ll get round to it (feel free to give me a gentle reminder if not :) ).

    Like the thumbnail view BTW. I might look at building a few more tools in the New Year – maybe something to automate the thumbnail view and other similar things. I hadn’t taken a serious look yet at Dave’s Art Manager, but I was aware of it – I’ll check it out.

    Thanks again Jo – and glad it’s now working!

  • Matt Simner:

    Hi Jo,

    I’ve made an update (you may need to clear things out first) that adds Page number and Work ID as you requested. Hope it does what you expected.

    Have a good Christmas!

  • geetwee

    geetwee

    Thanks Matt for this. That is really helpful. Now I just need a log analyzer to see what images are viewed during the day. One minor nibble: the ID doesn’t come out correctly. The last number of the ID doesn’t show up. This line as far as I can see coughs up the ID: stats[i].ID = srcParts[srcParts.length 2].substr(0, srcParts[srcParts.length -2].indexOf("“) -1);
    I figured the -1 on the end of the line jumped back one character before the – so I removed it like this
    stats[i].ID = srcParts[srcParts.length -2].substr(0, srcParts[srcParts.length -2].indexOf(”-"));
    and now it works OK.
    Thanks for all the effort.
    Jo

  • Matt Simner:

    Nice pickup! – my dodgy coding there. I think it was a copy and paste error but that’s always a bit of a cop out :)

    Fixed now in the original location. Looks like I’ll be doing some sort of stats analysis next :) Hopefully the RB boys will beat me to it.

  • geetwee

    geetwee

    Oops, some way the – sign from the code doesn’t show up.

  • Walter Quirtmair

    Walter Quirtmair

    Hi Matt, I installed this and don’t know if its working.

    After clicking “Retrieve CSV Stats” all I see is in the page tab header “http://www.redbubble.com/mybubble&#8221;, an empty page and in the bottom I can read “www.google.analytics read”. Then there’s no reaction for hours…

    I have 1638 works on 82 art pages on RB. Could this be a problem?

    Thanks for your feedback,
    Walter

  • Matt Simner:

    Hi Walter – I must admit I haven’t looked at this for a while, and yes it does appear to be be broken. The issue is that this is a script that’s written to work with the site and how it works ‘at that time’ – and I’ve had to change all the scripts a number of times when RB changes things (technically) at their end.

    I think the number of works certainly would mean things take a long time (I’d estimate 5-10 mins maybe), but something’s definitely changed on the site that’s broken the script, as it no longer works for me (with much less works). I’ll try and look at this soon, and hopefully find a more permanent solution.

  • Walter Quirtmair

    Walter Quirtmair

    Hi Matt, thanks for your response! It’s great you take a look at the script, thanks for your time and efforts :-)

  • Sheila Laurens

    Sheila Laurens

    Hi Matt, can you please tell me if the CSV stats script still works with the new 2010 RB layout. I cant find the Quicklink anywhere on the page after the script has been installed.
    Kind Regards

  • Matt Simner:

    Hi Sheila,

    The recent site updates broke the script in a fairly large way. I’ll try and get it going again, but at this stage I’m afraid I can’t promise whether or when it will return (as I’m not sure how much work would be involved in getting it to fit the new site).

    I’ll certainly keep you posted, as you’re not the only one to ask…

    Cheers,
    Matt

  • Sheila Laurens

    Sheila Laurens

    Thank you Matt
    Have a great Christmas and New Year X

Add Your Comment

You need to login or signup to add your comment to this work.