TeamRaiser Fundraising Thermometer

Options
We want to use an API to embed our TR fundraising thermometer on our Wordpress Website. Does anyone know which API to use? Also, how can you control the appearance of the thermometer?
Tagged:

Comments

  • I was surprised to not find a way to get this in the APIs.


    If that's really the case, then all is not lost. This is available with an S-Tag.


    You can follow Noah's post about "Roll Your Own APIs". (https://community.blackbaud.com/forums/viewtopic/1/2775?post_id=20586)

    The S-Tags are ruined from the first community platform migration, but basically you make a PageBuilder page that renders as JSON, with a S-Tags embedded for supplying the data.


    Here's a super simple example to render the amount raised for our Radiothon campaign.

    { "amountRaised":"[[S15:1221:amountRaised]]" }


    And then you call it like this:
    https://secure1.convio.net/ABC/site/SPageServer?pagename=jsonp_radiothon_donations&pgwrap=n


    You can get clever with passing in data in the calling url query string, and then populating the S-tag. Remember to change the outer S-Tag to an E-Tag.

    {

    "teamraiser": {

    { "title":"[[E42:[[S334:fr_id]]:title]]" },

    { "days-to-event":"[[E42:[[S334:fr_id]]:days-to-event]]" },

    { "dollars":"[[E42:[[S334:fr_id]]:dollars]]" },

    { "goal":"[[E42:[[S334:fr_id]]:goal]]" }

    }

    }



    Which you would call like:

    ?pagename=myAPI&fr_id=1234&pgwrap=n



    A ways back Noah revealed an undocumented API method to run a single S-Tag. Perfect if you don't need a bunch of data returned as above.

    https://community.blackbaud.com/forums/viewtopic/100/35616?post_id=133808#p133808

    luminateExtend.api({

    api: 'content',

    data: 'method=render&content=[[LL]]S42:1234:dollars[[LR]]',

    requiresAuth: true

    })




    EDIT: As for the appearance, well, the possibilities are endless. After your script runs, you know the amount and the goal. You could use that with some JQuery to set the height of the mercury div inside of the thermometer div. Or display from a collection of images. There are also tons of available scripts and jquery plugs around to do some pretty fancy graphing these days. (https://www.jqueryscript.net/tags.php?/pie%20chart/)


    BPM
  • If you happen to be using AngularJS on your website, the angular-luminate-utils module has a method for parsing S-Tags that makes that whole roll-your-own process much simpler. The example in the documentation shows how to get the amount raised for an event:

    https://github.com/noahcooper/angular-luminate-utils#evaluating-template-tags-with-luminatetemplatetag
  • We are rolling our own API pulling out the Donation Campaign progress using the S15 solution. However, we're running into a big caching issue. Once the page is loaded, the refresh time is not ideal for our campaigns that have people refreshing quite often.

    Any way around that? I think it's partially the load balancing that happens - sometimes the new total is there, sometimes it's the old total. Just depends.

    Does anyone have any hot tips that don't include saving the values and comparing them and then only loading the higher total?


    It would definitely be simpler if there was a donation campaign info API.
  • I think the solution here would be to add a unique value to the url that holds your JSON, so your script always retrieves a fresh version. The S9 tag returns the current time, which should do the trick. The timestamp param formats that time as a large number (which is something like seconds since 1/1/1900.)

    https://secure1.convio.net/ABC/site/SPageServer?pagename=jsonp_radiothon_donations&pgwrap=n&ts=[[S9:timestamp]]
  • Thanks, Brian! We're trying that out and still seeing the numbers come back strange. Sneaking suspicion it's something at the server level that is inconsistently retrieving totals.


    Does anyone at Blackbaud know of any plans for an API that allows for Campaign Progress? We use this across our sites and now have to figure out a new solution.

Categories