Facility Control

 View Only
Expand all | Collapse all

Sportzcast

  • 1.  Sportzcast

    Posted 07-15-2019 13:53

    Hi

     

    I am not sure of the workflow and may be asking some dumb questions. My apologies.

     

    I have 90% completed my modificiation of Chris' HockeyScore program so that it functions with vMix. I am now on to my real tasks. A DASHBoard interfcae for XPression for a hockey broadcast.

    1. I am expecting to have a Sportzcast scorebot which will send an XML file with the live data to my computer. Should I be accessing this file in DASHBoard or XPression. ie can DASHBoard read this file and give me access to that data.

     

    2. Once I have that issue resolved (and programmed) I will need to look at other data, direct from the net which is JSON fomatted API. But that is for another day, I want to resolve the Sportzcast portion.

    Thanks

     

    Whit



  • 2.  RE: Sportzcast

    Posted 07-22-2019 09:17

    I've not tried Sportzcast before, and you got me curious here now...
    So, the XML is the allready supported version to use in Xpression through DataLinq, and that should be no problem.
    But just out of curiosity, what other ways of communication is there? Like, how does it send data to other applications?


    #DashBoard


  • 3.  RE: Sportzcast

    Posted 07-22-2019 11:44

    Good morning

    Prior game time, I log into the Sportzcast server. I have previously indicated what type of file to send (Excel or XML) and where it is to be saved on my computer. The data in the file represents every element the local scoreboard ( hockey in my case) can generate. Scoreboards for other sports can often generate many more items.

    Very simple process. We will be using the "entry" level version which sends the scoreclock data to their server and then the XML downloads to my computer every  second or so.. Other versions send the scoreboard data right to your computer, no internet.

    Here is one of our scorebot's XML file, of course the clock is not running right now ( it is 7:25 AM here

    ?xml version="1.0" encoding="utf-8"?>
    <info>
    <site>Richcraft Sensplex - Potvin</site>
    <BOT>1615</BOT>
    <layer>
    </layer>
    <gameid>
    </gameid>
    <vendor>OES</vendor>
    <sport>Hockey</sport>
    <clock>
    </clock>
    <clockmin>
    </clockmin>
    <clocksec>
    </clocksec>
    <shotclock>
    </shotclock>
    <clockstatus>
    </clockstatus>
    <clockmode>
    </clockmode>
    <shotclockstatus>
    </shotclockstatus>
    <Hscore>
    </Hscore>
    <Vscore>
    </Vscore>
    <Hgoal>
    </Hgoal>
    <Vgoal>
    </Vgoal>
    <HshotsOnGoal>
    </HshotsOnGoal>
    <VshotsOnGoal>
    </VshotsOnGoal>
    <Hsaves>
    </Hsaves>
    <Vsaves>
    </Vsaves>
    <Htimeout>
    </Htimeout>
    <Hfulltimeouts>
    </Hfulltimeouts>
    <Hpartialtimeouts>
    </Hpartialtimeouts>
    <Vtimeout>
    </Vtimeout>
    <Vfulltimeouts>
    </Vfulltimeouts>
    <Vpartialtimeouts>
    </Vpartialtimeouts>
    <Hplayer>
    </Hplayer>
    <Vplayer>
    </Vplayer>
    <period>
    </period>
    <periodtext>
    </periodtext>
    <horn>
    </horn>
    <Hteam><![CDATA[ ]]></Hteam>
    <Vteam><![CDATA[ ]]></Vteam>
    <Hplayer1>
    </Hplayer1>
    <Hplayer1clock> : </Hplayer1clock>
    <Hplayer1clockmin>
    </Hplayer1clockmin>
    <Hplayer1clocksec>
    </Hplayer1clocksec>
    <Hplayer1pentype1>
    </Hplayer1pentype1>
    <Hplayer1pentype2>
    </Hplayer1pentype2>
    <Hplayer2>
    </Hplayer2>
    <Hplayer2clock> : </Hplayer2clock>
    <Hplayer2clockmin>
    </Hplayer2clockmin>
    <Hplayer2clocksec>
    </Hplayer2clocksec>
    <Hplayer2pentype1>
    </Hplayer2pentype1>
    <Hplayer2pentype2>
    </Hplayer2pentype2>
    <Hplayer3>
    </Hplayer3>
    <Hplayer3clock> : </Hplayer3clock>
    <Hplayer3clockmin>
    </Hplayer3clockmin>
    <Hplayer3clocksec>
    </Hplayer3clocksec>
    <Hplayer3pentype1>
    </Hplayer3pentype1>
    <Hplayer3pentype2>
    </Hplayer3pentype2>
    <Vplayer1>
    </Vplayer1>
    <Vplayer1clock> : </Vplayer1clock>
    <Vplayer1clockmin>
    </Vplayer1clockmin>
    <Vplayer1clocksec>
    </Vplayer1clocksec>
    <Vplayer1pentype1>
    </Vplayer1pentype1>
    <Vplayer1pentype2>
    </Vplayer1pentype2>
    <Vplayer2>
    </Vplayer2>
    <Vplayer2clock> : </Vplayer2clock>
    <Vplayer2clockmin>
    </Vplayer2clockmin>
    <Vplayer2clocksec>
    </Vplayer2clocksec>
    <Vplayer2pentype1>
    </Vplayer2pentype1>
    <Vplayer2pentype2>
    </Vplayer2pentype2>
    <Vplayer3>
    </Vplayer3>
    <Vplayer3clock> : </Vplayer3clock>
    <Vplayer3clockmin>
    </Vplayer3clockmin>
    <Vplayer3clocksec>
    </Vplayer3clocksec>
    <Vplayer3pentype1>
    </Vplayer3pentype1>
    <Vplayer3pentype2>
    </Vplayer3pentype2>
    <hexbot>
    </hexbot>
    <timestamp>0001-01-01 00:00:00.000</timestamp>
    </info>

    Hard to envision the file structure here but the XPATH is <info>

    Trust this is what byou were asking.

    I am going to pose these questions in the community

    XPression community:

    Is there a technique, maybe it would be a simpler process, to have just 1 item per graphic in the sequencer and walk thru or select the desired datalinq

     

    Dashboard Community

    I would really like to be able to view the DataLinq items in Dashboard. And be able to issue a command (Rosstalk) to step thru or select the desired row in the DataLinq

     

    Something like

    <Graphic name or SEQ#>  <Text area name>  <select DataLinq row (index or next or previous)>

    I will post these questions later today.

     

    Whit

     


    #DashBoard


  • 4.  RE: Sportzcast

    Posted 07-22-2019 12:08

    Morning! Or afternoon. It's the latter here in Norway!

    1. It's not quite what I'm after... I'm wondering if there is a way to like a "stream" from the Sportzcast.
      Like a UDP or TCP stream etc... Setting up a listener in DashBoard could let you take this info then into DashBoard as well.

    2. I think this can be done with "relid" if I dont misunderstand you completly.
      The "row" in the DataLinq setup in Xpresison can be manipulated through values like the takeID for example.
      See this one for a bit more info: https://www.rossvideo.com/gallery/xpression-u/video-tutorial-datalinq03/

    3. As far as I know, and I have asked about the exact same thing earlier, there is no DataLinq -> DashBoard.
      There is of course DashBoard -> DataLinq, but yeah...
      Maybe the DashBoard API sollution they have through Xpression will let you read this info, but that's just theoretical, as I've yet to try this API...

    #DashBoard


  • 5.  RE: Sportzcast

    Posted 07-22-2019 12:43

    Good afternoon

     

    I am sure in one of the videos I saw something like sportzcast.net.xxxxxx  as a DataLinq source. So I believe it can be done. I will explore further.

    Is "Listener" a widget or a generic term ? IS there a sample anywhere to view?

    I have access to several APIs (all JSON formatted) that I would love to be able to see in Dashboard.

    Thanks

     

    Whit


    #DashBoard


  • 6.  RE: Sportzcast

    Posted 07-22-2019 13:56

    Interesting. Could be fun to get more info about that.
    Sportzcast might be something for us as well at our Hockey Team.

    If you go into edit mode in DashBoard and double click on the background (or anywhere else really), and see the very top left, there are certain tags you can add. <listener> is among them. This basically lets you set up a listener for different communication modes (UDP is the simplest I would say), that lets you recieve and communicate with response (TCP) with other devices.
    Then you can take the message from whatever device and use that as you please in dashboard.
    I.e. you can take that message and populate parameters in DashBoard, and those parameters can again be sent through DataLinq to Xpression.

    And yes, JSON API can be used to populate data in DashBoard. If it's not sent through a connection like the above listener, then you'd have to have a timer that refreshes the data from the JSON API at set intervals. But all in all much the same.


    #DashBoard


  • 7.  RE: Sportzcast

    Posted 07-22-2019 20:30

    Thanks, as always, to Aleksander Stalsberg for lending a hand and helping the community.

    At present, DashBoard can feed information to the DataLinq server but is still unable to read it. The workaround would be to poll/read the Sportzcast JSON output, use JSON.parse to convert to objects, and load the object values into your parameters (which could then be streamed to XPression if you wish) or, as Aleksander suggests, write a <listener/> tag to do roughly the same thing.

    Cheers.

    James


    #DashBoard


  • 8.  RE: Sportzcast

    Posted 07-22-2019 21:59

    James, I must echo your comments re Aleksander, he has helped me significantly. He, like the members in this community and the Ross folks as well, have been very positive and helpful.

     

    I am now exploring the listener concept as suggested by Aleksander.. Might be naive of me to ask, but I have an API url that has the data I want ,as the game unfolds. The url pointing to the JSON data looks like this, where do I enter this to employ listener?

     

    http://www.thecchl.ca/stats/player-stats/7/25?playertype=skater&position=skaters&rookie=no&sort=points&statstype=expanded&page=1&league=1

     

    Thanks

     

    Whit


    #DashBoard


  • 9.  RE: Sportzcast

    Posted 07-23-2019 11:48

    Hi there! Thanks for the kind words, and allways happy to help!

    I did try your URL there Whit in the same way I get my stats from a similar source here in Norway, and it seems that is blocked on that URL. The HTTP response was Error 403, wich just means blocked or that you dont have access.
    That URL though is just some website URL that is supposed to be shown in a browser, and not really the JSON reply format we're after.
    An example of a JSON response we would want is something like this URL: http://date.jsontest.com/

    Now for your listener part. Listener is mainly used if the service you are using is sending messages to you on a specific port without you asking for is (UDP is fire and forget, TCP is a two way communication). In this case, I think you are better off using a timer and set it to say 10 seconds or so, and poll data from it every 10 seconds.


    #DashBoard


  • 10.  RE: Sportzcast

    Posted 07-23-2019 12:18

    Good day

     

    I really goofed with the URL. It should have been:

     

     

     

     

    I tried this code along with the debugger and low and behold it did return the JSON formatted data. Yeah.

    function cb(results)
    {
    ogscript.debug(results);
    }
    ogscript.asyncPost('', null, cb);

     

    But how would I really retrieve that data, see it and then make use of it. Probably involves parsing the JSON data?

     

    Thanks

    Whit

    Whit

     

     


    #DashBoard


  • 11.  RE: Sportzcast

    Posted 07-23-2019 12:27

    Ahhh! There you go! Yeah, that works.
    You can delete the URL now from here if you want to be sure, but yes, that works!

    I just put together a small little dashboard for you here that grabs the response and shows it for you, so you can test whatever JSON URL you please...

    Just make a new DashBoard and copy/paste this entire code as the whole DashBoard source code:

    <abs contexttype="opengear" dblinqport="2222" gridsize="20" id="_top">
    <meta>
    <params>
    <param access="1" maxlength="0" name="url" oid="url" type="STRING" value="" widget="text"/>
    <param access="1" maxlength="0" name="response" oid="response" type="STRING" value="" widget="multiline-text"/>
    </params>
    </meta>
    <button buttontype="push" height="100" left="20" name="Call JSON" top="140" width="1360">
    <task tasktype="ogscript">function handleData(resultData)
    {
    if (resultData == null)
    {
    ogscript.debug("NO DATA");
    }
    else
    {
    ogscript.debug('SUCCESS!');
    ogscript.debug(resultData);
    params.setValue('response', 0, resultData);

    }
    }

    var url = params.getValue('url', 0);
    ogscript.asyncPost(url, null, handleData);
    ogscript.debug('Trying to get JSON response..');</task>
    </button>
    <param expand="true" height="40" left="20" oid="url" top="100" width="1360"/>
    <label height="80" left="20" name="PASTE URL HERE" style="txt-align:center;font:bold;size:Biggest;" top="20" width="1360"/>
    <label height="80" left="20" name="Response:" style="txt-align:center;font:bold;size:Bigger;" top="240" width="1360"/>
    <param editable="false" expand="true" height="460" left="20" oid="response" scroll="vertical" showlabel="false" top="320" width="1360"/>
    <button buttontype="push" height="100" left="20" name="Clear response" top="780" width="1360">
    <task tasktype="ogscript">params.setValue('response', 0, '');</task>
    </button>
    </abs>

    I would also recommend this site here: https://jsonformatter.curiousconcept.com/
    Just copy/paste the JSON response into this, and click "Process", and you'll get a formatted and easy-to-read JSON response out.
    Makes it easier to see what you're working with.


    #DashBoard


  • 12.  RE: Sportzcast

    Posted 07-23-2019 12:46

    You are a saviour. Thank you. I have a few admin details to look after and then will get right to this.

     

    I have deleted the URL, thank you for that suggestion. I keep forgetting how public this forum is. I used to say it is like hanging your Monday morning wash out on your clothesline for the whole neighbourhood to see!

     

    Once I get this functioning, I can then decide if I want to make use of the data avilable in my other 30 APIs.

     

    Thanks again

     

    Back to clear up my admin duties then get at this.

     

    Whit

     


    #DashBoard


  • 13.  RE: Sportzcast

    Posted 07-23-2019 15:52

    Next "dumb" question. How do I handle that data ( look for line delimiters? parse?, ..) In my other goto software, vMix, the data source when accessed looks like this, and I can just select a row (with a mouse by script) to populate a graphic.

     


    #DashBoard


  • 14.  RE: Sportzcast

    Posted 07-24-2019 10:53

    Hi again Whit!

    Yeah, that's not really a stupid question if you've not parsed JSON before with Javascript...
    And getting a somewhat similar result to your table above can be done... That's actually exactly what I'm doing these days and trying to get done in a good way.

    Though it's actually quite a bit of work to be honest, and in the more advanced-end of the pool...
    But yes, you can indeed get the same result as with vMix and populate the graphics simply by mouse and choosing what row you want info on.

    What I would first recommend you do, is use vMix as you have above there, as it's a nice tool to see what info you are getting from the JSON, and then find the collumns you need, and limit the project to those.
    From what I could see when looking through your JSON feed from earlier, it's quite extensive, and hold many data points that are either not in use, or irrelevant to your graphics.

    So that would be your step 1. Prioritize and structure your graphics in order to limit the data you need to get from the JSON info.


    #DashBoard


  • 15.  RE: Sportzcast

    Posted 07-24-2019 11:45

    Here's another example DashBoard for you.. You'll have to supply the URL yourself (sorry to whoever else wants this but yeah, cant really share his URL without his consent here).

    What you might notice is that the "penalty" events time comes back as "undefined". That is because in the JSON response, the events that are penalties does not have a "time" with them. But only "time_off_formated"... In my opinion this is a bad JSON response from their part, but nothing to be done about that.

    What you'd need to do in order to get the correct time for those as well, is to add a condition while going through them.
    So you'd have to do a IF event is equal to penalty, then time will be the value in time_off_formatted instead of time.
    As you can see, if it's not present, then time will just be returned as undefined in those cases. I assume an event could also be a timeout, or any other happening, and if that event has it's own way of defining time, you'd have to add that as a condition as well.

    Anyways, have fun! And sorry, didnt have time to go through it as thorough as last time...
    Again, copy pase the code into a new empty dashboard.

    <abs contexttype="opengear" gridsize="20" id="_top">
    <meta>
    <params>
    <param access="1" maxlength="0" name="url" oid="url" type="STRING" value="" widget="text"/>
    <param access="1" maxlength="0" name="response" oid="response" type="STRING" value="" widget="multiline-text"/>
    <param access="1" maxlength="0" name="events" oid="events" type="STRING" value="Awaiting JSON results..." widget="default"/>
    </params>
    </meta>
    <button buttontype="push" height="100" left="20" name="Call JSON &amp; Get Period : Time : Event" top="140" width="920">
    <task tasktype="ogscript">function handleData(resultData)
    {
    if (resultData == null)
    {
    ogscript.debug("NO DATA");
    }
    else
    {
    ogscript.debug('SUCCESS!');
    ogscript.debug(resultData);
    params.setValue('response', 0, resultData);

    // Let's do something with the results!
    var obj = JSON.parse(resultData);
    var res = '';
    for (i in obj.GC.Pxpverbose) {
    var event = obj.GC.Pxpverbose[i].event;
    var period = obj.GC.Pxpverbose[i].period_id;
    var time = obj.GC.Pxpverbose[i].time;
    res = res + period + ' : ' + time + ' : ' + event + '\n';
    }
    params.setValue('events', 0, res);
    }
    }

    var url = params.getValue('url', 0);
    ogscript.asyncPost(url, null, handleData);
    ogscript.debug('Trying to get JSON response..');</task>
    </button>
    <param expand="true" height="40" left="20" oid="url" top="100" width="920"/>
    <label height="80" left="20" name="PASTE URL HERE" style="txt-align:center;font:bold;size:Biggest;" top="20" width="920"/>
    <label height="80" left="20" name="Response:" style="txt-align:center;font:bold;size:Bigger;" top="240" width="920"/>
    <param editable="false" expand="true" height="460" left="20" oid="response" scroll="vertical" showlabel="false" top="320" width="920"/>
    <button buttontype="push" height="100" left="20" name="Clear response" top="780" width="920">
    <task tasktype="ogscript">params.setValue('response', 0, '');</task>
    </button>
    <lines diagonals="false" height="900" left="960" percent="true" startarrow="false" thickness="3" top="20" width="20">
    <point x="50" y="0"/>
    <point x="50" y="100"/>
    </lines>
    <param editable="false" expand="true" height="700" left="1000" oid="events" scroll="vertical" style="txt-align:north;" top="80" widget="multiline-text" width="320"/>
    <button buttontype="push" height="100" left="1000" name="Clear events" top="780" width="320">
    <task tasktype="ogscript">params.setValue('events', 0, 'Awaiting JSON results...');</task>
    </button>
    </abs>

    #DashBoard


  • 16.  RE: Sportzcast

    Posted 07-24-2019 11:55

    My morning prayers answered, once again. Thank you Aleksander.

     

    I will do just that; review the fields that are available and select those I will actually utilize to populate the graphics.

    I have made some other decisions regarding the design of the final grid.

    I am assuming the workflow would be something like this;

    1. XPression and DataLinq configured first (pregame)
    2. the operator then only uses the Dashboard grid

    Although the scorebug (teams, time, period & scores), along with "ShotsOnGoal" & Penalty clocks will be handled via DataLinq in XPression; I think it would be an enhancement if the operator could see these items in the Dashboard panel. I will setup these areas on the panel to show these values, just so the operator can be aware of what is going on.

    Thanks for that little API tester, it is "neat" and very useful.

     

    Thanks

     

    Whit


    #DashBoard


  • 17.  RE: Sportzcast

    Posted 07-24-2019 14:28

    Furthr to my discussion above: I think I may change my dashboard grid to something like this:

    • Top row of buttons will simply be to "take" and remove graphics ( populted by DataLinq in XPN)
    • The "SCOREBUG" area is solely for the operator to see what is going on. Populated by Sportzcast XML
    • The "PLAY by PLAY" area is to see the API data and select a row and then "TAKE" with the relevant button.

    Other areas to be determined , hopefully at least the XPN Preview widget will work.

    That is my theory anyways. We shall see.

    Thanks

     

    Whit

     

    If email communication is more desirable for some items, oops just about gave you my address which will expire tomorrow. Changing providers, will now have 1.5 Gb down and 950 Mb up. Old address is wprophet@cogeco.ca; new address will be whitprophet2@gmail.com


    #DashBoard


  • 18.  RE: Sportzcast

    Posted 07-25-2019 20:31

    I am stymied with trying to access data within an array(?) in an object:

     

    {"id":"32488","event":"goal","goal_type":"","home":"0","team_id":"1","goal_player_id":"5827","assist1_player_id":"157","assist2_player_id":"5385","time":"18:46","time_formatted":"18:46","period":"3rd","x_location":0,"y_location":0,"location_set":"0","power_play":"0","empty_net":"0","penalty_shot":"0","short_handed":"0","insurance_goal":"0","game_winning":"0","game_tieing":"0","period_id":"3","scorer_goal_num":"11","s":1126,"plus":[],"minus":[],

    "goal_scorer":{"player_id":"5827","jersey_number":"28","team_id":"1","team_code":"ROC","first_name":"Gunnar","last_name":"Smith"},

    "assist1_player":{"player_id":"157","jersey_number":"24","team_id":"1","team_code":"ROC","first_name":"Griffin","last_name":"McGregor"},

    "assist2_player":{"player_id":"5385","jersey_number":"26","team_id":"1","team_code":"ROC","first_name":"Cole","last_name":"Craft"}}

     

    The values in the first part (where they are isolated) are easy to grab; but they are embedded one layer deeper in 

    • goal_scorer
    • assist1_player
    • assist2_player 

    with 

    var event = obj.GC.Pxpverbose[i].event;
    var period = obj.GC.Pxpverbose[i].period_id;
    var tim = obj.GC.Pxpverbose[i].time;

     

    How do I access the values in goal_scorer(player_id , jersey_number etc..)

     

    Thanks

     

    Whit


    #DashBoard


  • 19.  RE: Sportzcast

    Posted 07-25-2019 20:55

    Well, after lots of trying to figure this out, I tried this code, which works. I think I am on the right track

     

    for (i in obj.GC.Pxpverbose) {
    for (j in obj.GC.Pxpverbose[i].goal_scorer) {
    var number = obj.GC.Pxpverbose[i].goal_scorer[j];
    }

     

    Thank you, thank you


    #DashBoard


  • 20.  RE: Sportzcast

    Posted 07-25-2019 22:24

    Well... That's just another "level"... It's an object within the object again...
    To go one level "deeper" as you call it, just call it with a .

    Soooo in order to get the goal scorer jersey number it should be:

    Var jersey = obj.GC.Pxpverbose[i].goal_scorer.jersey_number;

    On my phone now, so I cant really test it, but just looking at it... I think that should work???


    #DashBoard


  • 21.  RE: Sportzcast

    Posted 07-26-2019 14:53

    A few quick comments on some of the above discussion.

    1. Making a readable string out of a JSON object - JSON.stringify (a built-in JavaScript function available in DashBoard) has a few formatting options you can also use.

    var jsonString = '{"some":"json"}';
    var jsonPretty = JSON.stringify(JSON.parse(jsonString),null,2);
    ogscript.debug(jsonPretty);

    2. Another option with inconsistent JSON formatting is to detect that something is undefined using typeof:

    if (typeof (obj) != 'undefined')
    {
        //DO SOMETHING
    }
    else
    {
       //DO SOMETHING ELSE
    }


    #DashBoard


  • 22.  RE: Sportzcast

    Posted 07-27-2019 17:11

    Hi

     

    I was thinking/hoping the embedded arrays could be accessed in a manner similiar to XPATH in XML:

     

    var jersey = obj.GC.Pxpverbose[i].goal_scorer.jersey_number;

     

    but no such luck. I did manage to access all the data using a couple of nested loops, but it isn't assigning the values to variables.

     

    // Let's do something with the results!
    var obj = JSON.parse(resultData);
    var res = '';
    for (i in obj.GC.Pxpverbose) {
    var event = obj.GC.Pxpverbose[i].event;
    var period = obj.GC.Pxpverbose[i].period_id;
    var time = obj.GC.Pxpverbose[i].time;
    var mins = obj.GC.Pxpverbose[i].minutes;
    var infraction = obj.GC.Pxpverbose[i].lang_penalty_description;

    res = res + period + ' : ' + time + ' : ' + event + ' :' + mins + ' : ' + infraction + ' : ' ;


    for (j in obj.GC.Pxpverbose[i].goal_scorer)
    {
    if (event = "goal")
    {
    var fname = obj.GC.Pxpverbose[i].goal_scorer[j];
    res = res + ' : ' + fname;
    }

    }


    for (j in obj.GC.Pxpverbose[i].player_penalized_info)
    {
    if (event = "penalty")
    {
    var lname = obj.GC.Pxpverbose[i].player_penalized_info[j];
    res = res + ' : ' + lname;
    }

    }

    res = res + '\n';



    }
    params.setValue('events', 0, res);
    }

     

    As I said I was hoping it would function like XPATH and be able to assign these values to variables, which would allow me to use them.

     

    If this is he route I must go, I now need to include the tasks from this into my master panel.

     

    Thanks

     

    Whit

     


    #DashBoard


  • 23.  RE: Sportzcast

    Posted 07-29-2019 14:07

    This thread is getting extyended but I wish to continue along this vein.

     

    Employing Aleksander's approach:

     

    I want to use a text input box to have the operator enter the "GameID"

    I want to concatenate this with the API url ( the CG operator wont know the entire url of the API).

    I was thinking it would be something like this, but Dashboard wont accept it:

     

    var gameid = params.getValue('gameid', 0);

    url = string.concat(https://lscluster.hockeytech.com/feed/index.php?feed=gc&key=xxxxyyyyyy&client_code=cchl&game_id=",gameid,"&lang_code=en&fmt=json&tab=pxpverbose"

    I get n error message the key identity must end with a ";"

     

    Is the ampersand causing this issue? Should they be replaced by their code?

     

    Thanks

     

    Whit


    #DashBoard


  • 24.  RE: Sportzcast

    Posted 07-29-2019 15:59

    Hi Whit.

    Are you editing directly in the source code or inside of the ogScript editor? If you're in the editor, ampersands are okay to use on their own.

    I do see a missing quote from the start of your call to concat. You can also just use "+" to concatenate your strings in this scenario.

     

    var url = "https://lscluster.hockeytech.com/feed/index.php?feed=gc&key=xxxxyyyyyy&client_code=cchl&game_id=" + gameid + "&lang_code=en&fmt=json&tab=pxpverbose";

    #DashBoard


  • 25.  RE: Sportzcast

    Posted 07-29-2019 18:50

    Thank you James, worked as you said.

     

    Thanks again.

     

    Whit


    #DashBoard


  • 26.  RE: Sportzcast

    Posted 07-29-2019 19:24

    Inching forward with this, thanks to all the folks who have responded.. Current project now looks like this:

    Now that I have the API data in the "events" multi line text box, can I make this scrollable ? Average game might have 15 or more events.

     

    Thanks

     

    Whit


    #DashBoard


  • 27.  RE: Sportzcast

    Posted 07-29-2019 20:03

    Just add scroll="vertical" to your param tag.


    #DashBoard


  • 28.  RE: Sportzcast

    Posted 07-29-2019 20:25

    Thank you sir, "cooking with gas" !


    #DashBoard