Opens a console window and reads latest FML (F**k my life) lines from the website. Testing the use of web clients without GUI and regular expression
Drop a comment if you want anything explained, and I will do my best.
'*****
'Get random FML
'Alex Jones
'4/12/09
'*****
Imports System.Text.RegularExpressions
Imports System.Console
Module Module1
Sub Main()
WriteLine("Loading .. ")
Do
RandomFML() 'call function for random fml
ReadLine() 'pause the console with a readline to read
Loop
End Sub
Sub RandomFML()
Dim Download As New System.Net.WebClient()
Dim GetPage As String = New System.Text.UTF8Encoding().GetString(Download.DownloadData("http://www.fmylife.com/random"))
Dim FmlRegex As Regex = New Regex("Today, .* FML#")
WriteLine(FmlRegex.Match(Regex.Replace(GetPage, "<[^<>]+>", "")).ToString.TrimEnd("#"))
End Sub
End Module