Skip to content

Instantly share code, notes, and snippets.

@ConnorMcF
Created April 23, 2015 20:25
Show Gist options
  • Save ConnorMcF/a6da09c50a33513ed329 to your computer and use it in GitHub Desktop.
Save ConnorMcF/a6da09c50a33513ed329 to your computer and use it in GitHub Desktop.
<?php
$host = 1; // don't allow chat widget to load
require('pusher.php');
$app_id = '110645';
$app_key = 'd15708a3ea089b2a9f4d';
$app_secret = '6ca8056c835ca42785b7';
$pusher = new Pusher($app_key, $app_secret, $app_id);
$data['ip'] = $_SERVER['REMOTE_ADDR'];
$data['songName'] = $_GET["title"];
$data['songAuthor'] = $_GET["author"];
$data['songId'] = $_GET["id"];
$data['songDuration'] = $_GET["duration"];
$data['user'] = $_GET["user"];
$pusher->trigger('notify', 'song', $data);
echo("done!");
?>
<iframe height="0" width="0" src="blank.php" style="visibility:hidden;display:none" id="sample"></iframe>
<script>
var videoData = player.getVideoData();
var title = videoData['title'];
var video_id = videoData['video_id'];
var author = videoData['author'];
var duration = player.getDuration();
var currentduration = player.getCurrentTime();
document.getElementById('sample').src = "heartbeatm8.php?title=" + title + "&author=" + author + "&id=" + video_id + "&duration=" + duration + "&current=" + currentduration;
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment