Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.68 KB | None | 0 0
  1. Imports System.Net
  2. Imports System.Threading
  3. Imports System.Text.RegularExpressions
  4. Module Module1
  5.     Sub Main()
  6.         btcupdate()
  7.         scrape()
  8.         Console.ReadLine()
  9.     End Sub
  10.     Dim btcprice As String
  11.     Dim ethereistprice As String
  12.     Dim ltcprice As String
  13.     Sub scrape()
  14.         Console.WriteLine("UID:")
  15.         Dim uid As String = Console.ReadLine()
  16.         Dim wc As New WebClient
  17.         wc.Headers.Add("User-Agent: Mozilla/4.0")
  18.         Dim source As String = wc.DownloadString(String.Format("https://hackforums.net/myawards.php?uid=" & uid.ToString))
  19.  
  20.         'awards
  21.        '=================================================================
  22.         Dim emerald As New List(Of String)
  23.         Dim richbitch As New List(Of String)
  24.         Dim benefactor As New List(Of String)
  25.         Dim litecoinage As New List(Of String)
  26.         Dim darkdash As New List(Of String)
  27.         Dim dogecoinage As New List(Of String)
  28.         Dim ethereist As New List(Of String)
  29.         Dim bitcoin As New List(Of String)
  30.         Dim gift As New List(Of String)
  31.         Dim legalizeit As New List(Of String)
  32.         Dim brony As New List(Of String)
  33.         Dim masterdoner As New List(Of String)
  34.         Dim GrandAmethyst As New List(Of String)
  35.         '=================================================================
  36.  
  37.        'Emerald
  38.         Dim em As New Regex("<strong>Emerald Donator</strong>")
  39.         For Each Match As Match In em.Matches(source)
  40.             emerald.Add(Match.ToString)
  41.  
  42.         Next
  43.  
  44.         'Rich Bitch
  45.        Dim rb As New Regex("<strong>Rich Bitch</strong>")
  46.        For Each Match As Match In rb.Matches(source)
  47.            richbitch.Add(Match.ToString)
  48.  
  49.        Next
  50.  
  51.  
  52.        'Benefactor
  53.         Dim bf As New Regex("<strong>Benefactor</strong>")
  54.         For Each Match As Match In bf.Matches(source)
  55.             benefactor.Add(Match.ToString)
  56.  
  57.         Next
  58.  
  59.         'Litecoinage
  60.        Dim lc As New Regex("<strong>Litecoinage</strong>")
  61.        For Each Match As Match In lc.Matches(source)
  62.            litecoinage.Add(Match.ToString)
  63.  
  64.        Next
  65.  
  66.        'DarkDash
  67.         Dim dd As New Regex("<strong>DarkDash</strong>")
  68.         For Each Match As Match In dd.Matches(source)
  69.             darkdash.Add(Match.ToString)
  70.  
  71.         Next
  72.  
  73.         'Dogecoinage
  74.        Dim dc As New Regex("<strong>Dogecoinage</strong>")
  75.        For Each Match As Match In dc.Matches(source)
  76.            dogecoinage.Add(Match.ToString)
  77.  
  78.        Next
  79.  
  80.        'Ethereist
  81.         Dim et As New Regex("<strong>Ethereist</strong>")
  82.         For Each Match As Match In et.Matches(source)
  83.             ethereist.Add(Match.ToString)
  84.  
  85.         Next
  86.  
  87.         'Bitcoin
  88.        Dim btc As New Regex("<strong>Bitcoinage</strong>")
  89.        For Each Match As Match In btc.Matches(source)
  90.            bitcoin.Add(Match.ToString)
  91.  
  92.        Next
  93.  
  94.        'Gift
  95.         Dim G As New Regex("<strong>Gift</strong>")
  96.         For Each Match As Match In G.Matches(source)
  97.             gift.Add(Match.ToString)
  98.  
  99.         Next
  100.  
  101.         'Legalizeit
  102.        Dim li As New Regex("<strong>Legalize It</strong>")
  103.        For Each Match As Match In li.Matches(source)
  104.            legalizeit.Add(Match.ToString)
  105.        Next
  106.  
  107.        'Brony
  108.         Dim br As New Regex("<strong>Brony</strong>")
  109.         For Each Match As Match In br.Matches(source)
  110.             brony.Add(Match.ToString)
  111.         Next
  112.  
  113.         'Master Doner
  114.        Dim md As New Regex("<strong>Master Donator</strong>")
  115.        For Each Match As Match In md.Matches(source)
  116.            masterdoner.Add(Match.ToString)
  117.        Next
  118.  
  119.        'Grand Amethyst
  120.  
  121.         Dim ga As New Regex("<strong>Grand Amethyst</strong>")
  122.         For Each Match As Match In ga.Matches(source)
  123.             GrandAmethyst.Add(Match.ToString)
  124.  
  125.         Next
  126.         Console.WriteLine()
  127.         Console.ForegroundColor = ConsoleColor.Magenta
  128.         'Calculate awards:
  129.        Console.WriteLine("Emerald Donator: $" & emerald.Count * 20)
  130.        Console.WriteLine("Rich Bitch: $" & richbitch.Count * 50)
  131.        Console.WriteLine("Litecoinage: $" & litecoinage.Count * 20)
  132.        Console.WriteLine("Darkdash: $" & darkdash.Count * 20)
  133.        Console.WriteLine("Dogecoinage: $" & dogecoinage.Count * 20)
  134.        Console.WriteLine("Ethereist: $" & ethereist.Count * 20)
  135.        Console.WriteLine("Bitcoinage: $" & bitcoin.Count * btcprice)
  136.        Console.WriteLine("Gift: $" & gift.Count * 25)
  137.        Console.WriteLine("Legalize It: $" & legalizeit.Count * 50)
  138.        Console.WriteLine("Brony: $" & brony.Count * 100)
  139.        Console.WriteLine("Master Doner: $" & masterdoner.Count * 500)
  140.        Console.WriteLine("Grand Amethyst: $" & GrandAmethyst.Count * 1000)
  141.        Console.WriteLine()
  142.        Console.ForegroundColor = ConsoleColor.Cyan
  143.        Console.WriteLine()
  144.  
  145.        Console.WriteLine("Total: $" & (emerald.Count * 20) + (richbitch.Count * 50) + (litecoinage.Count * 20) + (darkdash.Count * 20) + (dogecoinage.Count * 20) + (ethereist.Count * 20) + (bitcoin.Count * 500) + (gift.Count * 25) + (legalizeit.Count * 50) + (brony.Count * 100) + (masterdoner.Count * 500) + (GrandAmethyst.Count * 1000))
  146.        Console.WriteLine()
  147.    End Sub
  148.  
  149.  
  150.    Sub btcupdate()
  151.        Try
  152.            Dim wc As New WebClient
  153.            Dim source As String = wc.DownloadString(String.Format(("http://www.coindesk.com/price/")))
  154.            Dim reg As New Regex("<div class=""bpi-value bpiUSD"">.*?</div>")
  155.            For Each Match As Match In reg.Matches(source)
  156.                btcprice = Match.ToString.Split("$")(1).Split("<")(0)
  157.  
  158.            Next
  159.  
  160.        Catch ex As Exception
  161.        End Try
  162.    End Sub
  163. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement