Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <meta name="description" content="Virginia Tech Relay For Life statistics and countdown."/>
- <!-- Original from http://www.jbmarket.net/demos/countdown/ Modified by Adam Bloom-->
- <meta name="viewport" content="width=device-width">
- <title>VT Relay Dashboard</title>
- <link rel="stylesheet" href="/jbclock.css" type="text/css" media="all" />
- <script type="text/javascript" src="/jquery-1.8.0.min.js"></script>
- <script type="text/javascript" src="/jbclock.js"></script>
- <script type="text/javascript">
- var d = new Date();
- var n = d.getTime()/1000;
- $(document).ready(function(){
- JBCountDown({
- secondsColor : "#FFF",
- secondsGlow : "none",
- minutesColor : "#590075",
- minutesGlow : "none",
- hoursColor : "#e14e06",
- hoursGlow : "none",
- daysColor : "#860037",
- daysGlow : "none",
- startDate : "1375478529",
- endDate : "1398463200",
- now : n,
- });
- });
- </script>
- </head>
- <body>
- <div class="wrapper">
- <h1><a href="http://vtrelay.org" target="_blank" style="color:#e14e06">Virginia Tech Relay For Life!</a></h1>
- <h4>
- <?php
- libxml_use_internal_errors(true);
- $doc = new DOMDocument();
- $doc->loadHTMLFile("http://main.acsevents.org/site/TR/RelayForLife/RFLCY14SA?pg=entry&fr_id=60186");
- $xpath = new DOMXPath($doc);
- $teams = $xpath->query("//*[@id='tr-greeting-eventStats']/p/a[1]");
- $teams = str_replace("teams",$null,$teams->item(0)->nodeValue);
- $participants = $xpath->query("//*[@id='tr-greeting-eventStats']/p/a[2]");
- $participants = str_replace("participants",$null,$participants->item(0)->nodeValue);
- $money = $xpath->query("//*[@id='tr-greeting-eventStats']/p/span[@id='tr-greeting-fundraisingStats']");
- $money = str_replace("$",$null,$money->item(0)->nodeValue);
- $teams = str_replace(",",$null,$teams);
- $participants = str_replace(",",$null,$participants);
- $money = str_replace(",",$null,$money);
- $previous = explode(" ",file_get_contents("Changes.txt"));
- //Check to make sure the numbers didn't go down...
- if ($previous[0] > $teams) {
- $teams = $previous[0];
- }
- if ($previous[1] > $participants) {
- $participants = $previous[1];
- }
- if ($previous[2] > $money) {
- $money = $previous[2];
- }
- $string = str_replace(",",$null,$teams.$participants.$money);
- if (count(explode(' ', $string)) > 2) {
- file_put_contents("Changes.txt",$string);
- }
- //Adding commas and decimals
- $money = number_format(floatval($money), 2, '.', ',');
- $participants = number_format(floatval($participants));
- $teams = number_format(floatval($teams));
- echo '<a href="http://main.acsevents.org/site/TR?fr_id=60186&pg=teamlist" style="color:#e14e06" target="_blank">'.$teams.
- ' teams</a> and <a href="http://main.acsevents.org/site/TR?fr_id=60186&pg=topparticipantlist" style="color:#e14e06" target="_blank">'.$participants.
- ' participants</a> have raised <strong>$'.$money.'</strong>';
- ?>
- </h4>
- <div class="clock">
- <!-- Days -->
- <div class="clock_days">
- <div class="bgLayer">
- <div class="topLayer"></div>
- <canvas id="canvas_days" width="188" height="188">
- </canvas>
- <div class="text">
- <p class="val">0</p>
- <p class="type_days">Days</p>
- </div>
- </div>
- </div>
- <!-- Days -->
- <!-- Hours -->
- <div class="clock_hours">
- <div class="bgLayer">
- <div class="topLayer"></div>
- <canvas id="canvas_hours" width="188" height="188">
- </canvas>
- <div class="text">
- <p class="val">0</p>
- <p class="type_hours">Hours</p>
- </div>
- </div>
- </div>
- <!-- Hours -->
- <!-- Minutes -->
- <div class="clock_minutes">
- <div class="bgLayer">
- <div class="topLayer"></div>
- <canvas id="canvas_minutes" width="188" height="188">
- </canvas>
- <div class="text">
- <p class="val">0</p>
- <p class="type_minutes">Minutes</p>
- </div>
- </div>
- </div>
- <!-- Minutes -->
- <!-- Seconds -->
- <div class="clock_seconds">
- <div class="bgLayer">
- <div class="topLayer"></div>
- <canvas id="canvas_seconds" width="188" height="188">
- </canvas>
- <div class="text">
- <p class="val">0</p>
- <p class="type_seconds">Seconds</p>
- </div>
- </div>
- </div>
- <!-- Seconds -->
- </div>
- <div class="divider">
- <p>In the meantime, why not <strong>follow</strong> us on <a href="http://twitter.com/VTRelay" target="_blank"><strong>Twitter</strong></a>
- and <strong>like</strong> us on <a href="http://facebook.com/VTRelay" target="_blank"><strong>Facebook!</strong></a> You can also find us on <a href="http://instagram.com/VTRelay" target="_blank"><strong>Instagram</strong></a> and <a href="http://pinterest.com/VTRelay" target="_blank"><strong>Pinterest</strong></a></p>
- </div>
- </div><!--/wrapper-->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement