Posts Tagged ‘XML

12
Apr
09

[PHP/XML] Image Gallery

Wrote a function today to parse an XML file to create an image gallery table:
http://sim0n.net46.net/files/Image%20Gallery.php

The XML files structure is set up like this, similar to that of an RSS feed:

<?xml version="1.0" encoding="iso-8859-1"?&gt;
<channel>
	<thumb></thumb>
	<name>sim0n Gallery RSS</name>
	<date></date>
	<description>sim0n Gallery RSS</description>
	<link>https://sim0n.wordpress.com</link>
	<item>
		<thumb>Clouds_thm.jpg</thumb>
		<name>Clouds - Seamless 1 Tile</name>
		<date>12 April 2009</date>
		<description><![CDATA[A 1-image seamless tile that can be used as a repeating texture or background]]></description>
		<link>Clouds.html</link>
	</item>
	<item>
		<thumb>Meadow_thm.jpg</thumb>
		<name>Meadow - Seamless 2 Tile</name>
		<date>12 April 2009</date>
		<description><![CDATA[A 2-image seamless tile that can be used as a repeating texture or background]]></description>
		<link>Meadow.html</link>
	</item>
</channel>

It turned out quite nicely, now all i need to do is implement an easy way for me to add items to the gallery, shouldn’t be too hard.

Advertisements
08
Apr
09

[VB.Net] Release: MSN Chat Log Reader 2

MSN Chat Log Reader 2

Main Window

Main Window

Features:

  • Custom Message colours
  • Custom Message options
  • Custom Save options
  • Remove messages from Log
  • Export as Comma Separated Text File (*.csv)
  • Export as Comma Separated Text File (*.txt)
  • Export as Tab Separated Text File (*.txt)
  • Reduces MSN Log file sizes when re-saved:
    msn-chat-log-reader-2-saved1

    Downloads & Source Code:
    Continue reading ‘[VB.Net] Release: MSN Chat Log Reader 2’

    08
    Apr
    09

    [VB.Net] Parse MSN Logs

    Little function for parsing MSN logs. They are structured in XML, so arnt too hard to read:

        Private Sub ParseMSNLogFile(ByVal Filename As String)
            ''Create our XML Reader
            Dim XML_Reader As New System.Xml.XmlTextReader(Filename)
            ''XML Headers
            XML_Reader.Read()
            XML_Reader.Read()
            XML_Reader.Read()
            XML_Reader.Read()
            XML_Reader.Read()
            ''Read Session Details
            Dim FirstSessionID = XML_Reader.GetAttribute("FirstSessionID")
            Dim LastSessionID = XML_Reader.GetAttribute("LastSessionID")
            ''Create Reading Loop
            While Not XML_Reader.EOF
                XML_Reader.Read()
                ''Get Message Date - Could alternatly get the DateTime attribute
                Dim MDate As String = XML_Reader.GetAttribute("Date")
                ''Get Message Time - Could alternatly get the DateTime attribute
                Dim MTime As String = XML_Reader.GetAttribute("Time")
                ''Get the ID of the current message
                Dim MSessionID As String = XML_Reader.GetAttribute("SessionID")
                XML_Reader.Read()
                XML_Reader.Read()
                ''Get the FriendlyName of the user who send the message
                Dim FromFriendlyName As String = XML_Reader.GetAttribute("FriendlyName")
                XML_Reader.Read()
                XML_Reader.Read()
                XML_Reader.Read()
                ''Get the FriendlyName of the user who recieved the message
                Dim ToFriendlyName As String = XML_Reader.GetAttribute("FriendlyName")
                XML_Reader.Read()
                XML_Reader.Read()
                ''Get the style of the message (Fonts & colours)
                Dim MStyle As String = XML_Reader.GetAttribute("Style")
                ''Get the messages content
                Dim MText As String = XML_Reader.ReadString
                XML_Reader.Read()
            End While
        End Sub

    That function in effects, does nothing other than read the file. It outputs nothing, and does not handle multi-person conversations.
    Check back for an example usage in a program in a bit.