Skip to content

Instantly share code, notes, and snippets.

Created March 24, 2013 04:28
Show Gist options
  • Save anonymous/5230545 to your computer and use it in GitHub Desktop.
Save anonymous/5230545 to your computer and use it in GitHub Desktop.
'COPYRIGHT 2013
'GPLv3
'THIS IS FREE SOFTWARE REALEASED UNDER THE GPLv3 LICENSE
'gnu.org/licenses/gpl.txt
'Developers - Skilo
Imports System.Net
Imports System.IO
Imports System.Web.Script.Serialization
Public Class Form1
Private Function getHTML(ByVal Address As String) As String
Dim rt As String = ""
Dim out As String
Dim wRequest As WebRequest
Dim wResponse As WebResponse
Dim SR As StreamReader
wRequest = WebRequest.Create(Address)
wResponse = wRequest.GetResponse
SR = New StreamReader(wResponse.GetResponseStream)
rt = SR.ReadToEnd
SR.Close()
Dim js As New System.Web.Script.Serialization.JavaScriptSerializer
Dim testObj = js.Deserialize(rt, New Object().GetType())
out = "Last Trade: " + testObj("Last Trade") + Environment.NewLine
out += "Best Bid: " + testObj("Best Bid") + Environment.NewLine
out += "Best Ask: " + testObj("Best Ask")
Return out
End Function
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = getHTML("http://www.campbx.com/api/xticker.php")
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment