projects
/
Marketplaylister.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
v0.3.1:
[Marketplaylister.git]
/
callback.php
diff --git
a/callback.php
b/callback.php
index
2b92014
..
be99a1a
100644
(file)
--- a/
callback.php
+++ b/
callback.php
@@
-7,7
+7,6
@@
const BASE_URL = 'https://api.spotify.com/v1/';
\r
const AUTH_URL = 'https://accounts.spotify.com/';
\r
const DATE_FILE = 'prev_date.txt';
\r
const BASE_URL = 'https://api.spotify.com/v1/';
\r
const AUTH_URL = 'https://accounts.spotify.com/';
\r
const DATE_FILE = 'prev_date.txt';
\r
- const DATE_FORM = 'm/d/Y';
\r
const MONTHS = [
\r
'01' => 'January',
\r
'02' => 'February',
\r
const MONTHS = [
\r
'01' => 'January',
\r
'02' => 'February',
\r
@@
-135,7
+134,7
@@
$uris = [];
\r
\r
$pdo = new PDO("sqlite:mktplc.sqlite3");
\r
$uris = [];
\r
\r
$pdo = new PDO("sqlite:mktplc.sqlite3");
\r
- $stmt = $pdo->prepare("SELECT uri FROM songs s WHERE
(SELECT strftime('%m', s.date) == :month and strftime('%Y', s.date) == :year;
");
\r
+ $stmt = $pdo->prepare("SELECT uri FROM songs s WHERE
uri IS NOT NULL AND strftime('%m', s.date) == :month AND strftime('%Y', s.date) == :year
");
\r
$stmt->bindParam(':month', $state[0]);
\r
$stmt->bindParam(':year', $state[1]);
\r
if ($stmt->execute()) {
\r
$stmt->bindParam(':month', $state[0]);
\r
$stmt->bindParam(':year', $state[1]);
\r
if ($stmt->execute()) {
\r
@@
-168,7
+167,4
@@
echo '<br />';
\r
print_r(json_encode($update_data));
\r
$update_req = file_get_contents(BASE_URL . 'users/' . $me_id . '/playlists/' . $playlistID . '/tracks', false, $update_context);
\r
echo '<br />';
\r
print_r(json_encode($update_data));
\r
$update_req = file_get_contents(BASE_URL . 'users/' . $me_id . '/playlists/' . $playlistID . '/tracks', false, $update_context);
\r
- print_r($update_req);
\r
-
\r
- file_put_contents(DATE_FILE, $recentEpDT->format(DATE_FORM));
\r
-
\ No newline at end of file
+ print_r($update_req);
\ No newline at end of file