Imports System.Xml ''' ''' Digg Notify - Made by "Rub3X". Cyber-Knowledge.net ''' This program sends a quick pop up when someone has dugg one of your stories. When it hits FP it will stop monitoring. ''' ''' Public Class frmMain Private rand As New Random Public objXMLDoc As New XmlDocument Dim objNode As System.Xml.XmlNode Dim strPath = Application.StartupPath & "\Config.ini" Dim arrDiggCount(100) As String Dim strSliceMsg As String = "" Dim i As Integer = 0 Dim strCheckHmpg As String = "" Private SysTimer As System.Timers.Timer Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load txtUser.Text = INIRead(strPath, "Config", "User", "Username") SysTimer = New System.Timers.Timer AddHandler SysTimer.Elapsed AddressOf SysTimer_Elapsed End Sub Private Sub SysTimer_Elapsed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SysTimer.Elapsed 'May need a different signature Dim Thread As New System.Threading.Thread(AddressOf DiggUpdate) Thread.IsBackground = True Thread.Priority = Threading.ThreadPriority.Normal Thread.Start() 'DiggUpdate() End Sub 'Private Delegate Sub DiggUpdateDelegate() Public Sub DiggUpdate() i = 0 objXMLDoc.Load("http://digg.com/rss/" & txtUser.Text & "/index1.xml") For Each elemOut As Xml.XmlElement In objXMLDoc.GetElementsByTagName("item") For Each elemIn As Xml.XmlElement In elemOut.GetElementsByTagName("digg:diggCount") arrDiggCount(i) = elemIn.ChildNodes(0).InnerText i = i + 1 Next elemIn Next elemOut i = 0 lstStories.Items.Clear() For Each objNode In objXMLDoc.SelectNodes("rss/channel/item") lstStories.Items.Add(objNode.SelectSingleNode("title").InnerText) If INIRead(strPath, txtUser.Text, objNode.SelectSingleNode("title").InnerText, "") = "" Then INIWrite(strPath, txtUser.Text, objNode.SelectSingleNode("title").InnerText, arrDiggCount(i)) End If If arrDiggCount(i) - INIRead(strPath, txtUser.Text, objNode.SelectSingleNode("title").InnerText, "") > 1 Or arrDiggCount(i) > 30 Then strCheckHmpg = objNode.SelectSingleNode("title").InnerText End If If INIRead(strPath, txtUser.Text, objNode.SelectSingleNode("title").InnerText, "") <> arrDiggCount(i) And INIRead(strPath, "Ignored", objNode.SelectSingleNode("title").InnerText, "0") <> 1 Then Dim strTitle As String = objNode.SelectSingleNode("title").InnerText If strTitle.Length > 40 Then strTitle = strTitle.Substring(0, 40) & "..." End If INIWrite(strPath, txtUser.Text, objNode.SelectSingleNode("title").InnerText, arrDiggCount(i)) strSliceMsg = strSliceMsg & strTitle & "(" & arrDiggCount(i) & ")" & vbCrLf End If i = i + 1 Next If strSliceMsg <> "" Then Dim slice As New frmToast(Me.rand.Next(5000, 10000), strSliceMsg) slice.Height = Me.rand.Next(150, 150) slice.Show() i = 0 strSliceMsg = "" End If If strCheckHmpg <> "" Then objXMLDoc.Load("http://digg.com/rss/containertechnology.xml") For Each objNode In objXMLDoc.SelectNodes("rss/channel/item") If objNode.SelectSingleNode("title").InnerText = strCheckHmpg Then INIWrite(strPath, "Ignored", strCheckHmpg, "1") End If Next strCheckHmpg = "" End If End Sub Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click If tmrUpdate.Enabled = True Then tmrUpdate.Enabled = False btnStart.Text = "Start" Else tmrUpdate.Enabled = True btnStart.Text = "Pause" End If If INIRead(strPath, "Config", "User", "") <> txtUser.Text Then INIWrite(strPath, "Config", "User", txtUser.Text) End If End Sub Private Sub btnIgnore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIgnore.Click INIWrite(strPath, "Ignored", lstStories.SelectedItem, "1") End Sub End Class