Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
173 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
cron: | ||
- description: store pings | ||
url: /cron/store_pings | ||
schedule: every 10 minutes | ||
#- description: store pings | ||
# url: /cron/store_pings | ||
# schedule: every 10 minutes | ||
|
||
- description: generate playlists toplist | ||
url: /cron/generate_playlists_toplist | ||
schedule: every 5 minutes | ||
#- description: generate playlists toplist | ||
# url: /cron/generate_playlists_toplist | ||
# schedule: every 5 minutes | ||
|
||
- description: get last_updated for external users | ||
url: /cron/update_external_users | ||
schedule: every 5 minutes | ||
#- description: get last_updated for external users | ||
# url: /cron/update_external_users | ||
# schedule: every 5 minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Youtify</title> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<link rel="icon" type="image/png" href="/images/logo/logo_16x16.png" sizes="16x16" /> | ||
<link rel="icon" type="image/png" href="/images/logo/logo_32x32.png" sizes="32x32" /> | ||
<link rel="icon" type="image/png" href="/images/logo/logo_64x64.png" sizes="64x64" /> | ||
<link rel="icon" type="image/png" href="/images/logo/logo_128x128.png" sizes="128x128" /> | ||
<link rel="icon" type="image/png" href="/images/logo/logo_512x512.png" sizes="512x512" /> | ||
<style> | ||
.actions .logout, .actions .download { display: none; } | ||
</style> | ||
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | ||
<script> | ||
window.youtify = { loginUrl: null, userid: null, dump: '' }; | ||
window.console = (window.console || { log: function(){} }); | ||
|
||
$.getJSON('/api/main', function(data) { | ||
var $btn = $('.actions .export'); | ||
console.log(data); | ||
youtify.loginUrl = data.loginUrl; | ||
youtify.logoutUrl = data.logoutUrl; | ||
youtify.userid = (data.user || { id: null }).id; | ||
youtify.username = (data.user || { displayName: null }).displayName; | ||
if (!youtify.userid) | ||
$btn.text('here'); | ||
else if (youtify.username) { | ||
$btn.text('here (' + youtify.username + ')'); | ||
$('.actions .logout').show().prop('href', youtify.logoutUrl); | ||
} | ||
$btn.on('click', function(event) { | ||
$btn.prop('disabled', true); | ||
if (youtify.userid) { | ||
$.getJSON('/api/users/' + youtify.userid + '/playlists', function(data) { | ||
var calls = 0; | ||
$.each(data, function(index, item) { | ||
calls += 1; | ||
$.get('/api/playlists/' + item.remoteId, function(data, x, y) { | ||
console.log(data); | ||
youtify.dump += data.title + '\n' + '===' + '\n'; | ||
var playlists = JSON.parse(data.videos) || []; | ||
for (i = 0; i < playlists.length; i += 1) { | ||
if (playlists[i].type === 'youtube') | ||
youtify.dump += playlists[i].title + '\t' + 'http://www.youtube.com/watch?v=' + playlists[i].videoId + '\n'; | ||
else if (playlists[i].type === 'soundcloud') | ||
youtify.dump += playlists[i].title + '\t' + 'http://www.soundcloud.com' + '\n'; | ||
else | ||
youtify.dump += playlists[i].title + '\n'; | ||
} | ||
youtify.dump += '\n'; | ||
calls -= 1; | ||
}); | ||
}); | ||
var t = setTimeout(function() { | ||
console.log(calls) | ||
if (calls === 0) { | ||
clearTimeout(t); | ||
if (youtify.dump.length === 0) { | ||
$('.actions').text(' - No data found.'); | ||
} else { | ||
$('.actions .export, .actions .logout').hide(); | ||
$('.actions .download') | ||
.prop('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(youtify.dump)) | ||
.show(); | ||
} | ||
} | ||
}, 100); | ||
}); | ||
} else { | ||
window.location = youtify.loginUrl; | ||
} | ||
return false; | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="content"> | ||
<h1>Youtify is no more</h1> | ||
<p>Youtify was a skin for playing videos from YouTube and music from SoundCloud.</p> | ||
<p>Previous users can download data | ||
<span class="row actions"> | ||
<a href="#" class="export">here</a> | ||
<a href="#" class="download" download="youtify-backup.txt">save text file</a><br /><br /> | ||
<a href="#" class="logout">Logout</a><br /> | ||
</span> | ||
</p> | ||
<p>All data will be permanently deleted February the 1th, 2015.</p> | ||
</div> | ||
</body> | ||
</html> |