Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've now successfully been able to get the data I needed. I used the <code>/venues/</code> endpoint with the id of the venues that 'we' own. I then bundled these into a <code>/multi/</code> endpoint request (I used an array of calls to get over the 5 request limit). My jQuery code is below (I'm on a classic ASP server and without loading other libraries can't use JSON).</p> <pre><code>var endpoint = "https://api.foursquare.com/v2/multi?requests="; var numbers = new Array(); numbers[0] ="/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID]"; numbers[1] = "/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID]"; numbers[2] = "/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID]"; numbers[3] = "/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID],/venues/[VENUE ID]"; numbers[4] = "/venues/[VENUE ID],/venues/[VENUE ID]"; var auth_string = "&amp;client_id=[CLIENT ID]&amp;client_secret=[CLIENT SECRET]&amp;v=[DATE in YYYYMMDD]"; var checkins = 0; var tips = 0; $.each(numbers,function(index,value) { $.getJSON(endpoint + numbers[index] + auth_string,function(json){ $.each(json.response.responses,function(index){ checkins = checkins + json.response.responses[index].response.venue.stats.checkinsCount; tips = tips + json.response.responses[index].response.venue.stats.tipCount; }); $("#foursq #checkins").html("Checkins: " + checkins + "&lt;br /&gt;"); $("#foursq #tips").html("Tips: " + tips); }); }); </code></pre> <p>This basically just loops through every venue grabs the stats for checkinsCount and tipCount and then adds them to the total. It then prints these into wherever you want to display. I've found an issue with the count though as if you don't print the values off outside of the 'getJSON' loop it becomes 0.</p> <p>Hope this helps anyone else doing something similar</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload