-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
executable file
·95 lines (93 loc) · 4.06 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<html>
<head>
<title>181.fm The Mix - Scrobble to last.fm account</title>
<link rel="stylesheet type="text/css" href="style.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function geturlx()
{
trackNumber = "";
duration = "";
params = "";
params += "submissionType=track";
params += "&username=" + encodeURIComponent(document.getElementById("username").value);
params += "&password=" + encodeURIComponent(document.getElementById("password").value);
params += "&artist=" + encodeURIComponent(document.getElementById("artist").innerHTML);
params += "&track=" + encodeURIComponent(document.getElementById("trackName").innerHTML);
params += "&album=";
params += "&number=" + trackNumber;
params += "&duration=" + duration;
$.ajax({
url: "http://universalscrobbler.invitationstation.org/scrobble.php",
dataType: 'json',
data: params,
success: true
});
}
</script>
<script type="text/javascript">
function setLogin(){
var usernameLogin = document.getElementById('username').value;
var passwordLogin = document.getElementById('password').value;
var field = document.createElement('div');
field.setAttribute('type','hidden');
field.setAttribute('id','hiddenuser');
field.setAttribute('value',usernameLogin);
document.getElementById('signin').appendChild(field);
var field = document.createElement('div');
field.setAttribute('type','hidden');
field.setAttribute('id','hiddenpassword');
field.setAttribute('value',passwordLogin);
document.getElementById('signin').appendChild(field);
$("#login").hide();
$("#signin").show();
document.getElementById('currentUser').innerHTML = usernameLogin;
}
function logout(){
$("hiddenuser").remove();
$("hiddenpassword").remove();
$("#signin").hide();
$("#login").show();
}
</script>
</head>
<body>
<div id="header">
<div id="lastfm"><img src="images/lastfm.jpg" alt="last.fm" /></div>
<div id="headerText">scrobbling for 181.fm</div>
</div>
<div id="login" style="display: block;">
<div class="loginsection">
<label class="loginsectionhor">last.fm username</label>
<input id="username" name="username" type="text" value="SampleUsername" />
</div>
<div class="loginsection">
<label class="loginsectionhor">password</label>
<input id="password" name="password" type="password" value="SamplePassword" />
</div>
<div id="setLoginWrapper">
<div id="setLogin" onclick=setLogin();>Login</div>
</div>
</div>
<div id="signin" style="display: none;">
<label>Signed in as</label>
<div id="currentUser">SampleCurrentUser</div>
<a id="logout" href="" onclick="logout();">Logout</a>
</div>
<div id="content">
<div id="trackinfobox">
<div id="nowPlayingTrack">Now Playing</div>
<div id="artist">Sample Artist</div>
<div id="seperator"> - </div>
<div id="trackName">Sample Track</div>
<!-- <div id="trackinfomaster">Sample track info</div> -->
</div>
<iframe id="theMixNowPlaying" name="theMixNowPlaying" src="http://localhost/host/181TheMix/fetchCurrentSong.php" width="0" height="0" frameborder=0></iframe>
<div id="integrate">
<a href="javascript: geturlx()">Scrobble using this</a>
</div>
</div>
<div id="footer">
</div>
</body>
</html>