[VB.net] Sloppy Grooveshark player source

Discussion in 'Distribution' started by BottomNotch, Apr 14, 2013.

  1. BottomNotch

    BottomNotch United States Game Killer

    Post Count:
    2,317
    Likes Received:
    1
    Stats
    Code:
    Imports System.Text.RegularExpressions
    Imports System.Net
    'Credits to Xynth
    Public Class Form1
    
    
            
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        End Sub
    
    
        Private Sub ExcisionButtonBlue1_Click(sender As Object, e As EventArgs) Handles ExcisionButtonBlue1.Click
            Dim gotIt As ReturnValues = SearchGrooveshark(TextBox1.Text, "b3d447a31b34b05980e64cb45fe018a8")
            BackgroundWorker1.RunWorkerAsync()
            Label2.Text = "Song: " & gotIt.SongName
            Label3.Text = "Artist: " & gotIt.ArtistName
            Label4.Text = "Album: " & gotIt.AlbumName
            Label5.Text = gotIt.URL
            Label6.Text = Label5.Text.Replace("http:\/\/tinysong.com\/", "http://www.tinysong.com/")
            If ExcisionCheckBox2.Text = "Empty" Then
                ExcisionCheckBox2.Text = Label2.Text.Replace("Song: ", "")
                Label7.Text = Label6.Text
                Label18.Text = Label2.Text
                Label29.Text = Label3.Text
                Label40.Text = Label4.Text
            ElseIf ExcisionCheckBox3.Text = "Empty" Then
                ExcisionCheckBox3.Text = Label2.Text.Replace("Song: ", "")
                Label8.Text = Label6.Text
                Label19.Text = Label2.Text
                Label30.Text = Label3.Text
                Label41.Text = Label4.Text
            ElseIf ExcisionCheckBox4.Text = "Empty" Then
                ExcisionCheckBox4.Text = Label2.Text.Replace("Song: ", "")
                Label9.Text = Label6.Text
                Label20.Text = Label6.Text
                Label31.Text = Label3.Text
                Label42.Text = Label4.Text
            ElseIf ExcisionCheckBox5.Text = "Empty" Then
                ExcisionCheckBox5.Text = Label2.Text.Replace("Song: ", "")
                Label10.Text = Label6.Text
                Label21.Text = Label2.Text
                Label32.Text = Label3.Text
                Label43.Text = Label4.Text
            ElseIf ExcisionCheckBox6.Text = "Empty" Then
                ExcisionCheckBox6.Text = Label2.Text.Replace("Song: ", "")
                Label11.Text = Label6.Text
                Label22.Text = Label2.Text
                Label33.Text = Label3.Text
                Label44.Text = Label4.Text
            ElseIf ExcisionCheckBox7.Text = "Empty" Then
                ExcisionCheckBox7.Text = Label2.Text.Replace("Song: ", "")
                Label12.Text = Label6.Text
                Label23.Text = Label2.Text
                Label34.Text = Label3.Text
                Label45.Text = Label4.Text
            ElseIf ExcisionCheckBox8.Text = "Empty" Then
                ExcisionCheckBox8.Text = Label2.Text.Replace("Song: ", "")
                Label13.Text = Label6.Text
                Label24.Text = Label2.Text
                Label35.Text = Label3.Text
                Label46.Text = Label4.Text
            ElseIf ExcisionCheckBox9.Text = "Empty" Then
                ExcisionCheckBox9.Text = Label2.Text.Replace("Song: ", "")
                Label14.Text = Label6.Text
                Label25.Text = Label2.Text
                Label36.Text = Label3.Text
                Label47.Text = Label4.Text
            ElseIf ExcisionCheckBox10.Text = "Empty" Then
                ExcisionCheckBox10.Text = Label2.Text.Replace("Song: ", "")
                Label15.Text = Label6.Text
                Label26.Text = Label2.Text
                Label37.Text = Label3.Text
                Label48.Text = Label4.Text
            ElseIf ExcisionCheckBox11.Text = "Empty" Then
                ExcisionCheckBox11.Text = Label2.Text.Replace("Song: ", "")
                Label16.Text = Label6.Text
                Label27.Text = Label2.Text
                Label38.Text = Label3.Text
                Label49.Text = Label4.Text
            ElseIf ExcisionCheckBox12.Text = "Empty" Then
                ExcisionCheckBox12.Text = Label2.Text.Replace("Song: ", "")
                Label17.Text = Label6.Text
                Label28.Text = Label2.Text
                Label39.Text = Label3.Text
                Label50.Text = Label4.Text
            Else
            End If
        End Sub
    
    
        Private Sub ExcisionButtonDefault1_Click(sender As Object, e As EventArgs) Handles ExcisionButtonDefault1.Click
            Try
                WebBrowser1.Document.GetElementById("play-pause").InvokeMember("click")
            Catch ex As Exception
    
    
            End Try
            If ExcisionCheckBox2.Checked Then
                Label4.Text = Label40.Text
                Label2.Text = Label18.Text
                Label3.Text = Label29.Text
                WebBrowser1.Navigate(Label7.Text)
            ElseIf ExcisionCheckBox3.Checked Then
                Label4.Text = Label41.Text
                Label3.Text = Label30.Text
                Label2.Text = Label19.Text
                WebBrowser1.Navigate(Label8.Text)
            ElseIf ExcisionCheckBox4.Checked Then
                Label4.Text = Label42.Text
                Label3.Text = Label31.Text
                Label2.Text = Label20.Text
                WebBrowser1.Navigate(Label9.Text)
            ElseIf ExcisionCheckBox5.Checked Then
                Label4.Text = Label43.Text
                Label3.Text = Label32.Text
                Label2.Text = Label21.Text
                WebBrowser1.Navigate(Label10.Text)
            ElseIf ExcisionCheckBox6.Checked Then
                Label4.Text = Label44.Text
                Label3.Text = Label33.Text
                Label2.Text = Label22.Text
                WebBrowser1.Navigate(Label11.Text)
            ElseIf ExcisionCheckBox7.Checked Then
                Label4.Text = Label45.Text
                Label3.Text = Label34.Text
                Label2.Text = Label23.Text
                WebBrowser1.Navigate(Label12.Text)
            ElseIf ExcisionCheckBox8.Checked Then
                Label4.Text = Label46.Text
                Label3.Text = Label35.Text
                Label2.Text = Label24.Text
                WebBrowser1.Navigate(Label13.Text)
            ElseIf ExcisionCheckBox9.Checked Then
                Label4.Text = Label47.Text
                Label3.Text = Label36.Text
                Label2.Text = Label25.Text
                WebBrowser1.Navigate(Label14.Text)
            ElseIf ExcisionCheckBox10.Checked Then
                Label4.Text = Label48.Text
                Label3.Text = Label37.Text
                Label2.Text = Label26.Text
                WebBrowser1.Navigate(Label15.Text)
            ElseIf ExcisionCheckBox11.Checked Then
                Label4.Text = Label49.Text
                Label3.Text = Label38.Text
                Label2.Text = Label27.Text
                WebBrowser1.Navigate(Label16.Text)
            ElseIf ExcisionCheckBox12.Checked Then
                Label4.Text = Label50.Text
                Label3.Text = Label39.Text
                Label2.Text = Label28.Text
                WebBrowser1.Navigate(Label17.Text)
            End If
        End Sub
    
    
        Private Sub ExcisionButtonDefault2_Click(sender As Object, e As EventArgs) Handles ExcisionButtonDefault2.Click
            Try
                WebBrowser1.Document.GetElementById("play-pause").InvokeMember("click")
            Catch ex As Exception
    
    
            End Try
        End Sub
    
    
        Private Sub ExcisionCircleButton1_Click(sender As Object, e As EventArgs) Handles ExcisionCircleButton1.Click
            Try
                WebBrowser1.Document.GetElementById("play-prev").InvokeMember("click")
            Catch ex As Exception
    
    
            End Try
        End Sub
    
    
        Private Sub ExcisionButtonWhite2_Click(sender As Object, e As EventArgs) Handles ExcisionButtonWhite2.Click
            Try
                WebBrowser1.Document.GetElementById("play-next").InvokeMember("click")
            Catch ex As Exception
    
    
            End Try
        End Sub
    
    
        Private Sub ExcisionButtonWhite1_Click(sender As Object, e As EventArgs) Handles ExcisionButtonWhite1.Click
            Try
                WebBrowser1.Document.GetElementById("play-prev").InvokeMember("click")
            Catch ex As Exception
    
    
            End Try
        End Sub
    
    
        Private Sub ExcisionCheckBox1_CheckedChanged(sender As Object) Handles ExcisionCheckBox1.CheckedChanged
                Try
                    WebBrowser1.Document.GetElementById("volume").InvokeMember("click")
                Catch ex As Exception
    
    
                End Try
    
    
        End Sub
    #Region " Code "
        Public Function GetBetween(ByRef strSource As String, ByRef strStart As String, ByRef strEnd As String, _
                          Optional ByRef startPos As Integer = 0) As String
            Dim iPos As Integer, iEnd As Integer, lenStart As Integer = strStart.Length
            Dim strResult As String
    
    
            strResult = String.Empty
            iPos = strSource.IndexOf(strStart, startPos)
            iEnd = strSource.IndexOf(strEnd, iPos + lenStart)
            If iPos <> -1 AndAlso iEnd <> -1 Then
                strResult = strSource.Substring(iPos + lenStart, iEnd - (iPos + lenStart))
            End If
            Return strResult
    
    
    
    
        End Function
    
    
        Public Function SearchGrooveshark(ByRef strSearchTerm As String, ByRef strKey As String)
            Dim URL As String = "http://tinysong.com/b/" & strSearchTerm.Replace(" ", "+") & "?format=json&key=" & strKey
            Dim getIt As New ReturnValues
            Dim Source As String = New System.Net.WebClient().DownloadString(URL)
            getIt.SourcePage = Source
            Dim q As String = Chr(34)
            getIt.SongName = GetBetween(Source, """SongName"":""", q & ",")
            getIt.ArtistName = GetBetween(Source, """ArtistName"":""", q & ",")
            getIt.AlbumName = GetBetween(Source, """AlbumName"":""", q & "}")
            getIt.URL = GetBetween(Source, """Url"":""", q & ",")
            Return getIt
        End Function
    
    
        Public Class ReturnValues
            Friend SongName As String
            Friend ArtistName As String
            Friend AlbumName As String
            Friend URL As String
            Friend SourcePage As String
        End Class
    #End Region
        Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
            Try
                WebBrowser1.Navigate(Label6.Text)
                ExcisionCheckBox1.Checked = False
            Catch ex As Exception
                MessageBox.Show("Oh no! Couldn't find the desired song!")
            End Try
        End Sub
    
    
        Private Sub ExcisionCheckBox2_CheckedChanged(sender As Object) Handles ExcisionCheckBox2.CheckedChanged
            If ExcisionCheckBox2.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox3_CheckedChanged(sender As Object) Handles ExcisionCheckBox3.CheckedChanged
            If ExcisionCheckBox3.Checked Then
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox4_CheckedChanged(sender As Object) Handles ExcisionCheckBox4.CheckedChanged
            If ExcisionCheckBox4.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox5_CheckedChanged(sender As Object) Handles ExcisionCheckBox5.CheckedChanged
            If ExcisionCheckBox5.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox6_CheckedChanged(sender As Object) Handles ExcisionCheckBox6.CheckedChanged
            If ExcisionCheckBox6.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox7_CheckedChanged(sender As Object) Handles ExcisionCheckBox7.CheckedChanged
            If ExcisionCheckBox7.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox8_CheckedChanged(sender As Object) Handles ExcisionCheckBox8.CheckedChanged
            If ExcisionCheckBox8.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox9_CheckedChanged(sender As Object) Handles ExcisionCheckBox9.CheckedChanged
            If ExcisionCheckBox9.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox10_CheckedChanged(sender As Object) Handles ExcisionCheckBox10.CheckedChanged
            If ExcisionCheckBox10.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox11_CheckedChanged(sender As Object) Handles ExcisionCheckBox11.CheckedChanged
            If ExcisionCheckBox11.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox2.Checked = False
                ExcisionCheckBox12.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionCheckBox12_CheckedChanged(sender As Object) Handles ExcisionCheckBox12.CheckedChanged
            If ExcisionCheckBox12.Checked Then
                ExcisionCheckBox3.Checked = False
                ExcisionCheckBox4.Checked = False
                ExcisionCheckBox5.Checked = False
                ExcisionCheckBox6.Checked = False
                ExcisionCheckBox7.Checked = False
                ExcisionCheckBox8.Checked = False
                ExcisionCheckBox9.Checked = False
                ExcisionCheckBox10.Checked = False
                ExcisionCheckBox11.Checked = False
                ExcisionCheckBox2.Checked = False
            End If
        End Sub
    
    
        Private Sub ExcisionRadioButton1_CheckedChanged(sender As Object) Handles ExcisionRadioButton1.CheckedChanged
            If ExcisionRadioButton1.Checked = True Then
                ExcisionCheckBox2.Text = "Empty"
                ExcisionCheckBox3.Text = "Empty"
                ExcisionCheckBox4.Text = "Empty"
                ExcisionCheckBox5.Text = "Empty"
                ExcisionCheckBox6.Text = "Empty"
                ExcisionCheckBox7.Text = "Empty"
                ExcisionCheckBox8.Text = "Empty"
                ExcisionCheckBox9.Text = "Empty"
                ExcisionCheckBox10.Text = "Empty"
                ExcisionCheckBox11.Text = "Empty"
                ExcisionCheckBox12.Text = "Empty"
                ExcisionRadioButton1.Checked = False
            End If
        End Sub
    End Class
    
    Enjoy.
     

    Mr. Ad Advertisement

     
  2. Darktheif

    Darktheif United States Game Killer

    Post Count:
    3,226
    Likes Received:
    0
    Stats
    Lol I know where you got this fromXD But basically: It uses the webbrowser method and the invokeclick crap...
     
  3. BottomNotch

    BottomNotch United States Game Killer

    Post Count:
    2,317
    Likes Received:
    1
    Stats
    haha :P
     

Share This Page

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies.
    Dismiss Notice
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies.
    Dismiss Notice