Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • rasb 162 posts 218 karma points
    Feb 28, 2010 @ 00:21

    Live Scores Widget

    Hi Guys,

    I have created a smartphone app, for taking scores from a game I play with some friends.

    The phone transmits these scores live to my umbraco web site, where they are stored in a database. This all works fine.

    But what I would really like to do is create a widget that my friends can embed on their website, where they can display live scores. Preferably I would like this widget to be push updated, but a simple pull update could also be ok.

    I have never created widgets like this before, and don't know the best approach to doing this, and all input is welcome!


  • Seth Niemuth 275 posts 397 karma points
    Feb 28, 2010 @ 11:18
    Seth Niemuth

    The easiest thing may to just use iframe's (that is what google does with its calendar's). So, you would just create one page on your site where all it is is this live scores (no, header/navigation/etc). Then, you just give your friends the iframe for it. <iframe src="urlOfLiveScorePage" width="300px" height="300px" />. Then, on that page, you could auto-refresh and do whatever you wanted.

  • Daniel Lindstrom 454 posts 271 karma points
    Feb 28, 2010 @ 11:25
    Daniel Lindstrom

    One way of doing it, without .net:

    On your server server:

    1. Create an xslt macro that outputs the live scores as json, or maybe even html (more verbose but less js work on the client).

    2. Create an empty template and put the macro there.

    3. Create a content node and apply this template.

    The widget on the client web page:

    Write a small js script that

    1. Fetches the json data/html with jquery ajax.

    2. If json data transforms into html.

    3. Injects the html into selected container on the client page (div or similar).

    Proper web services or web methods in .net could be another ways of doing it. I like the method I have outlined because it makes it possible to do it all without opening visual studio, and is easy to modify using just the umbraco ui.


  • rasb 162 posts 218 karma points
    Feb 28, 2010 @ 15:41

    Hi Daniel,

    That looks like a good way of doing it. Do you have any pointers on where I should look for info on how to go about that?

    I like this method as well, because it doesn't have to refresh the page constantly... at least as I understand it.


Please Sign in or register to post replies

Write your reply to: