Tiernan OTooles Programming Blog

code and programming stuff from the hairy bloke!

July 2004 - Posts

NO MORE INVITES
I, and a lot of people, have not been given any more invites for quite some time now. people posting comments here and emailing me asking for invites are wasting their time! i dont have any, and as i said before, if i get them, they will go on freegmailinvites.com. Now, leave me alone!
Posted: Jul 21 2004, 02:47 PM by tiernanotoole | with no comments
Filed under:
my main blog could be moving to .TEXT
Ok. i have been using different weblog software over the last while now. First i used Movabletype, but it was too big and took up lots of resources. then i moved to Wordpress. this rocks and im still using it, but now im looking at .TEXT. Its written in C#, has a web service back end, and just rocks. im using it here on weblogs.ASP.NET but now im looking at running it at home. I'll be posting my progess here soon. I talked a bit about it on my other blog last night. Ohhh, and speaking of blogs, RSSAgg has died. not sure why. remote debugging is off, so i cant see from work. ill check it when i get home.
Posted: Jul 05 2004, 11:18 AM by tiernanotoole | with 2 comment(s)
Filed under:
Code for RSSAgg

Ok. yesterday i said i would post some code for RSSAgg, and here it is. Im only going to post some little bits because im lazy, but they are the important parts so here it goes:

Firstly theres a function which does all the hard work. this gets data from the RSS Feeds and returns a dataset to the sub that called the functions:

    Public Function getdata() As DataSet

        Dim myDS As New DataSet ' the dataset

        Dim rsstable As New DataTable ' datatable that gets imported into the dataset

        Dim datecol As New DataColumn("Date") ' the date colum.

        datecol.DataType = System.Type.GetType("System.DateTime") ' set the type of data in the date colum to datetime

        rsstable.Columns.Add(datecol) ' add the date column to the table

        rsstable.Columns.Add(New DataColumn("Title")) ' add a new title colum to the table

        rsstable.Columns.Add(New DataColumn("description")) ' add a new title colum to the table

        rsstable.Columns.Add(New DataColumn("link")) ' add a new title colum to the table

        rsstable.Columns.Add(New DataColumn("channel")) ' add a new title colum to the table

        rsstable.Columns.Add(New DataColumn("chanurl")) ' add a new title colum to the table

        Dim array As New ArrayList 'array of sites your to connect to

        array.Add("http://feeds.feedburner.com/blogspot/hnKu") ' links blog

        array.Add("http://blog.lotas-smartman.net/feed/") ' main blog

        array.Add("http://weblogs.asp.net/tiernanotoole/Rss.aspx") ' dev blog

        Dim x As Integer ' counter

        For x = 0 To array.Count - 1

            Dim feed As Rss.RssFeed = Rss.RssFeed.Read(array(x))

            Dim channel As Rss.RssChannel = feed.Channels(0)

            Dim i As Integer

            For i = 0 To channel.Items.Count - 1

                Dim myrow As DataRow

                myrow = rsstable.NewRow

                Dim item As New Rss.RssItem

                item = channel.Items(i)

                Dim mydate As Date

                mydate = item.PubDate

                myrow("Date") = mydate

                myrow("Title") = item.Title

                myrow("description") = item.Description

                myrow("link") = item.Link

                myrow("chanurl") = feed.Channels(0).Link

                myrow("channel") = feed.Channels(0).Title

                rsstable.Rows.Add(myrow)

                rsstable.AcceptChanges()

            Next

        Next

        myDS.Merge(rsstable)

        Return myDS

    End Function

As you can see, i kind of got board with the comments after a while. Now, then you have the page load sub:

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim cached As String = ""

        Dim ds As DataSet = Cache("RSSds")

        If Not ds Is Nothing Then

            cached = "Dataset cached"

        Else

            Dim ws As New rssAgg.RSSAggWS

            cached = "Dataset not cached"

            ds = getdata()

            Cache.Add("RSSds", ds, Nothing, DateTime.Now.AddMinutes(30), TimeSpan.Zero, Caching.CacheItemPriority.Normal, Nothing)

        End If

        ds.Tables(0).DefaultView.Sort = "date desc"

        Repeater1.DataSource = ds.Tables(0).DefaultView

        Repeater1.DataBind()

    End Sub

the variable "cached" used to be written out to show you if it was cached or not. now. some important things that are needed. Firstly you need RSS.NET. Not only that but you need to modified the code because of a date time problem with it. the info is in Bug 927898. i put in the code and it works grand now. currently its only parsing RSS2.0, or mainly RSS2.0 feeds, but RSS.net will do other RSS Feeds too. i might work on atom support, but not for a while now. Next task: SQL server for the back. the plan is to query the feeds every 15 or 30min and put the data into a SQL Server. then when the page is loaded, the page queries the DB and recives only the last 10 or 20 results. we will see later though! That could be a 0.2 alpha release. i might have an RSS feed for RSSAgg in at 0.15? keep checking back!

Posted: Jul 03 2004, 04:26 PM by tiernanotoole | with 1 comment(s)
Filed under: ,
RSSAgg 0.1 Alpha online!

check out the new release of RSSAgg! its back after some down time. hopefully all will go well. code some time tomorrow. not sure when though. stay tuned! :P

Posted: Jul 02 2004, 09:17 PM by tiernanotoole | with 1 comment(s)
Filed under:
RSSAgg: An update
Ok. sorry for the lack of posts about RSSAgg over the last while. I have been quite busy with different things and havent gotten a chance to play with RSSAgg. I have to fix a machine on my network, which was hosting most of my sites, now is now dead, and my workstation si doing most of the hosting. Thats being explained more here. Anyway, i hope to have RSSAgg working again soon. Textamerica, the moblog people, are working on RSS Feeds again. once that is up, ill be posting a lot more photos on the blog! Anyway, sorry again. a new build and code may be up soon!!
Posted: Jul 02 2004, 08:54 AM by tiernanotoole | with no comments
Filed under:
More Posts