Author Topic: Status Update by URL  (Read 29378 times)

mcfrojd

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Status Update by URL
« Reply #15 on: July 14, 2012, 12:23:13 PM »
Otherwise, why don't you use a wrapper to integrate your  stats pages ? http://wordpress.org/extend/plugins/wp-wrapper/

Tried that, problem is when viewing from mobile device, the stats in their table have some problems fitting a mobile screen.
Seeing more and more websites, templates and even joomla components getting full responsiveness, making them fully viewable from any device.

mcfrojd

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Status Update by URL
« Reply #16 on: July 14, 2012, 12:25:57 PM »
Is there any way to get the tournamen name/title to be pushed as an status update to?
Easier for website visitors to know what tournamen they see live stats for.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Status Update by URL
« Reply #17 on: July 14, 2012, 01:44:15 PM »
Absolutely.  Right now I just made it pass the same variables that are available to formulas.  Tournament title isn't useful to a formula.  But I knew I would be adding other items as requested.  So request away.

mcfrojd

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Status Update by URL
« Reply #18 on: July 14, 2012, 03:10:08 PM »
Great job Corey.

Any way to format the date from
Sat Jul 14 2012 21:19:18 GMT+0200 (Västeuropa, sommartid)
to
Jul 14 2012 - 21:19:18

http://poker.grantek.se/

And am i suppose to set the "update frequency" in TD3 to a very small number like 2 or 3 as well as in the TournamentStatus.js to get allmost instant uppdates?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Status Update by URL
« Reply #19 on: July 14, 2012, 09:26:17 PM »
Any way to format the date from
Sat Jul 14 2012 21:19:18 GMT+0200 (Västeuropa, sommartid)
to
Jul 14 2012 - 21:19:18

I didn't tackle the date because that's the only built-in date format in Javascript (and it's locale-specific).  To get a date formatted the way you like, you've got to build it yourself.  I'm sure there are other alternatives, too, like using a JQuery plug-in.

For the format you specified, add the following code to the TournamentStatus.js file (you can just paste it at the end of the file):

Code: [Select]
TDStatus.getDateTime = function(inDate)
{
  // Jul 14 2012 - 21:19:18
  var theMon = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];

  return theMon[inDate.getMonth()] + " " + inDate.getDate() + " " + inDate.getFullYear() + " - " + (inDate.getHours() + 1) + ":" + TDStatus.pad(inDate.getMinutes(), 2) + ":" + TDStatus.pad(inDate.getSeconds(), 2);
}

Then change this line:

Code: [Select]
TDStatus.setValue("lastupdated", "" + new Date(parseInt(TDStatus.Vars["time"]) * 1000));
to this:

Code: [Select]
TDStatus.setValue("lastupdated", TDStatus.getDateTime(new Date(parseInt(TDStatus.Vars["time"]) * 1000)));
And am i suppose to set the "update frequency" in TD3 to a very small number like 2 or 3 as well as in the TournamentStatus.js to get allmost instant uppdates?

You can set the update frequency in TD3 as low as 1 second.  Since the TD basically does a "fire and forget" (it doesn't care really what the server says in response), you should be able to safely have it update once per second.

You'll have to experiment with the refresh setting in TournamentStatus.js.  As I said, I didn't really examine how it might behave if your server is slow to respond, or timeouts occur.  Might be fine, might not, I can't say.  Probably will be fine, but again, I just can't really say.  FYI, the refresh rate setting in TournamentStatus.js. is defined in seconds, but you can give it fractions, too.  Set it to .5 to have it update every 1/2 second.

mcfrojd

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Status Update by URL
« Reply #20 on: July 15, 2012, 05:37:52 AM »
The date format worked great.

The refresh rate is the one concerning me, it works great but i don't want to get i trouble with my web space provider, thinking maby an very low rate could get flagged as some sort of "attack".
Probably not thou, but I'm satisfied with leaving the rate at 5 sec to start with.

Once again, thanks for a lovely product and the fantastic respons on your users input.
In the middle of the summer you might think someone would like to relax and enjoy life instead of typing code.
Kudos to you Corey.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Status Update by URL
« Reply #21 on: July 15, 2012, 11:21:51 AM »
The refresh rate is the one concerning me, it works great but i don't want to get i trouble with my web space provider, thinking maby an very low rate could get flagged as some sort of "attack".
Probably not thou, but I'm satisfied with leaving the rate at 5 sec to start with.

I wouldn't worry about it.  Your hosting service should not only be able to handle it, but I think it's pretty unlikely to set off any alarms.  I went back and looked at TournamentStatus.js a little more closely and I think it should behave just fine no matter what you set the refresh to be.  It might get a little weird if you were to dynamically set it (there's a form built into the page to change the refresh rate, but it's not displayed by default; if you just change the refresh rate in TournamentStatus.js directly, there should be no trouble at all).

Once again, thanks for a lovely product and the fantastic respons on your users input.
In the middle of the summer you might think someone would like to relax and enjoy life instead of typing code.
Kudos to you Corey.

Actually, that is how some of us relax.  Sometimes.  :)

macacan

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Chorley Poker League
Re: Status Update by URL
« Reply #22 on: July 16, 2012, 02:09:19 AM »
OK, complete novice hear at this html and all this other stuff.

Just wandering if it is a simple thing that I could do.

I use a simple program to build my site, WYSIWYG, and upload using ftp.

Anybody know if I could get this to run using these or is it to complex.

 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Status Update by URL
« Reply #23 on: July 16, 2012, 12:11:05 PM »
It really shouldn't be very hard.  There's no coding, as the pages are already written for you.  Probably the hardest part will be making sure your website is configured to allow the statusListener.php page to write to the folder/directory in which it is installed.  So, setting it up should consist of:

1) Uploading statusListener.php, TournamentStatus.html, TournamentStatus.css, TournamentStatus.js files to your web server
2) Configuring your web server to allow statusListener.php to write the status file
3) Configuring the Status Updates feature in the TD to send status updates to the statusListener.php page on your website
4) Pointing your browser to the TournamentStatus.html page on your website

macacan

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Chorley Poker League
Re: Status Update by URL
« Reply #24 on: July 16, 2012, 12:34:48 PM »
It really shouldn't be very hard.  There's no coding, as the pages are already written for you.  Probably the hardest part will be making sure your website is configured to allow the statusListener.php page to write to the folder/directory in which it is installed.  So, setting it up should consist of:

1) Uploading statusListener.php, TournamentStatus.html, TournamentStatus.css, TournamentStatus.js files to your web server
2) Configuring your web server to allow statusListener.php to write the status file
3) Configuring the Status Updates feature in the TD to send status updates to the statusListener.php page on your website
4) Pointing your browser to the TournamentStatus.html page on your website


Cheers Corey

Will have a try over the next few weeks

 8) 8) 8) 8) 8) 8) 8) 8) 8)

macacan

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Chorley Poker League
Re: Status Update by URL
« Reply #25 on: July 28, 2012, 09:05:01 AM »
Anybody know wysiwyg ?.

Not a clue how to do this, all I do at the mo is build my site using the program WYSIWYG (What You See Is What You Get).
So all is very easy, it works a bit like Microsoft publisher, no html to write.

Then I just upload it to my web server.

Is the somewhere in wysiwyg to place the files or would it have to be somwhere on the server.

 8) 8) 8) 8) 8) 8) 8) 8) 8) 8) 8)

Seitz333

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Status Update by URL
« Reply #26 on: August 24, 2012, 10:46:26 PM »
Wow! I have not checked the forum for a while, glad to see there is some progress with the status updates. I will config my website and server tomorrow and see what happens.

Thanks!

Chuck

Seitz333

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Status Update by URL
« Reply #27 on: August 25, 2012, 04:37:02 PM »
I got it working pretty easy. One of the items I think most people would like to see being updated is the rankings along with total winnings.

I have changed the look/layout to fit my site.

http://www.seitz333.com/livetourney/tournamentstatus.html

Chuck
« Last Edit: August 25, 2012, 07:45:21 PM by Seitz333 »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Status Update by URL
« Reply #28 on: August 26, 2012, 08:08:55 PM »
The next step will be to add a lot more data, using a different format (probably JSON).  The current format was easy to implement in a quick fashion, but it's very limited.

NJPL

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • North Jersey Poker League
Re: Status Update by URL
« Reply #29 on: September 05, 2012, 07:33:59 PM »
This topic is exactly what I was looking for. I've managed to output the status to a simple page http://www.northjerseypoker.com/tstatus/view_status.html

I also ported it to our mobile site http://www.northjerseypoker.com/frame/live.php  --- (works with iphones, not sure if the site works with droid)