.NET Random FML

By Jonesy44 on Dec 04, 2009

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

Comments

Sign in to comment.
Jonesy44   -  Sep 04, 2010

It's a .NET script, you see the text above? Yeah, that's it. :)

 Respond  
LostTruths   -  Sep 02, 2010

wth is this?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.