<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>TSheets Theme Song</title>
</head>
<body>

<div id="container" style="width: 100%; text-align: center">
	<img id="song_art"/>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
	setInterval(function(){
		$.ajax({
			url: '/index.php/api/play_next_song'
		}).success(function(response) {
			var song = JSON.parse(response);
			$.ajax({
				url: 'https://api.spotify.com/v1/tracks/' + song.song_id
			}).success(function (response) {
				$('#song_art').prop('src', response.album.images[0].url);
				var player = new Audio;
				player.src = response.preview_url;
				player.play();
			});
		});
	}, 3000);
</script>
</body>
</html><commit_msg>query for song instead of require id<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>TSheets Theme Song</title>
</head>
<body>

<div id="container" style="width: 100%; text-align: center">
	<img id="song_art"/>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
	setInterval(function(){
		$.ajax({
			url: '/index.php/api/play_next_song'
		}).success(function(response) {
			var songRequest = JSON.parse(response);
			$.ajax({
				url: 'https://api.spotify.com/v1/search?q=' + songRequest.song_name + '+artist:' + songRequest.artist + '&type=track'
			}).success(function (response) {
				var song = response.tracks.items[0];
				$('#song_art').prop('src', song.album.images[0].url);
				var player = new Audio;
				player.src = song.preview_url;
				player.play();
			});
		});
	}, 3000);
</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.21508379888268156, 'fraction_numerical': 0.015083798882681564, 'mean_word_length': 4.283185840707965, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1175625', 'n_tokens_mistral': 727, 'n_tokens_neox': 640, 'n_words': 129}