May 2004 - Posts
Last night i started work on
RSSAgg again, and it works! ITS ALIVE!!! :) and its now using a
fix i found here for
RSS.NET. RSS.NET, BTW, is the RSS reader backend im currently using. Ill probably start using
ATOM.NET later for some of my feeds, but at the moment RSS.NET is doing a cool job. the fix listed above actually solves the problem of dates with some of my feeds. my
Mob Blog is still not generating RSS feeds so im working on my own! simple answer to the problem! :) anyway, more work later on it. BTW, the code im going to use to build my own photo blog is based around code i talked about and
linked to here. so, more work on that later!
I found this article on OreillyNet. very handy. and here was me thinking that Generics was a C# only thing. now all i have to do i figure out how to use it for something...
New Features in VB.NET — Generics by Wei-Meng Lee -- One of the new features in .NET Framework 2.0 is the support of Generics in the Intermediate Language (IL). As such, languages such as C# and VB.NET now support this new feature. You've heard a lot about Generics in C#, but seldom hear people talk about it in VB.NET. In this article, Wei-Meng Lee introduces Generics to the VB.NET programmer.
I found this FAQ about datetime in .NET and its very interesting. I use date time a lot in work apps and the problem is that the datetime info could either be US or GMT. with this FAQ, theres lot of info on best ways to store the data. sweet.
Right. some time over the weekend RSSAgg for reasons best known to its self. Since its being hosted outside and since debugging info is limited to local only, I cant get debugging info from it! So, with the ISA server i now have running on my network, i can actually get my workstation working as a server and hosting the page. Actually, come to think of it, it already is, but has the same problem. im in work and therefore not local to my server.
the page is here, but its returning an error at the moment. Ill fix it when i get home. BTW, that page may have some load problems. or the server i should say. its my Windows XP workstation, so its got limited connections.
Its a question that i havent been asked, but just in case i ever am, here is the answer. RSSAgg was built because i have a lot of different blogs: my main blog, my moblog, my software blog and my coding blog. im probably missing one or two out there. anyway, RSSAgg was developed to take the feeds generated by each of these and make it as one large feed. but not only that, build a page that shows the feeds so you can read the info there. Now, there are currently little problems. Firstly, my moblog is not generating an RSS Feed for some reason. My Software log is generating an RSS 0.92 Feed, which does not have a time or date in it. I knew i was forgetting something. My Links Blog! the links blog's feed is an Atom Feed, which is then converted into a RSS 2.0 Feed, but the date time is different. Insted of being returned as GMT Time, its returned as an other time, which makes Raccoom.Xml crash when it tries to import. Work on this will continue. Source is to be uploaded soon, hopefully!
check out the Pre alpha copy of RSSAgg. Its very basic at the moment, and im only using 2 of the blogs. but hopefully i can get the rest working later. Im also working on an RSS feed for it. Check it out. more work on the interface is to be done. Also, data can be upto 30 min old due to caching. Also, code will be uploaded eventually once I make it look a little better.
Mike Schinkel, president of
Xtras.Net, made
an offer on his
personal blog of a free
XDN Professional membership (
http://www.xtras.net/xdn) during the month of May 2004 for anyone that blogs about .NET frequently. Now thats a cool offer. With that and the free
ASP Resource Kit that Microsoft are offering on their site, thats a lot of Free Stuff! Ohhhh, and you cant forget the
VB Resource Kit either!
Due to a problem with the MS XML parser, or a problem with the RSS feeds im trying to read, dates of some of the feeds im reading are comming out wrong. I have decided to add
my software page to the list of rss feeds, but its RSS 0.92 ATM and has no date assoicated with each post. Not only that, but Text America's RSS feed is still down, my Links blog is returining a datetime value which the XML parser is not sure about (has -0500 at the end insted of GMT). the only ones that are working without problem at the moment are the
coding blog (this one!) and my
main blog. Im trying to get the software blog working properly so it is returning valid RSS 2.0, but it may take a while. im also looking at modifying the Links feed so that can be used too. More code, and hopefully a working link, will be posted soon.
Ok. i have been coding RSS agg for a while now, and i have some code working. It uses RSS.NET, so download that and add it to a project. im only posting some code now. ill have a full project post later some time. anyway, what you will need is RSS.NET, a VB windows application, and on the form a data grid. default names are used, so far, so the datagrid is called datagrid1. post this code into the project:
Dim agg As New DataSet
Dim rsstable As New DataTable
rsstable.Columns.Add(
New DataColumn("Date"))
rsstable.Columns.Add(
New DataColumn("Title"))
rsstable.Columns.Add(
New DataColumn("description"))
rsstable.Columns.Add(
New DataColumn("link"))
Dim array As New ArrayList
'Dim url As String = "http://lsmartman.textamerica.com/rss.asp?imgtype=full"
Dim url2 As String = "http://feeds.feedburner.com/blogspot/hnKu"
Dim url3 As String = "http://blog.lotas-smartman.net/wp-rss2.php"
Dim url4 As String = "http://weblogs.asp.net/tiernanotoole/Rss.aspx"
'array.Add(url)
array.Add(url2)
array.Add(url3)
array.Add(url4)
Dim x As Integer
For x = 0 To array.Count - 1
Dim feed As RssFeed = RssFeed.read(array(x))
Dim channel As 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 RssItem = channel.Items(i)
Dim mydate As Date
mydate = item.PubDate.ToString
myrow("Date") = mydate
myrow("Title") = item.Title
myrow("description") = item.Description
myrow("link") = item.Link
rsstable.Rows.Add(myrow)
rsstable.AcceptChanges()
Next
Next
rsstable.DefaultView.Sort = "date desc"
DataGrid1.DataSource = rsstable
The commented out RSS feed is commented out because Text America's RSS Feeds are broked ATM. When you run that you will get a new datatable which will be consumed by the datagrid. the only problem i have at the moment is the dates are showing up wrong. only the rss feed from weblogs.asp.net is working grand. im going to have to work on that soon.
So, this is an other CC of a post i posted on my other site. Since this is my code blog, i might as well post it here. also comming in handy for my RssAgg (which is kind of the name of the project) tool. Enjoy!
I was looking for code for making a data table which I could fill with what ever information I wanted to fill it with, and then use it for what ever I want to use it for. Its mainly because some of the things I’m working on are in multiple tables and even using an inner joins don’t help. So, this way I can create a datatable with the information I want in it, return it via either a webservice or what ever, and it works grand. The following is the code im using.
Dim dt As New DataTable ‘ create an empty table
Dim row As DataRow ‘ new row
Dim list As New ArrayList ‘ array list that holds the row information
Dim i As Integer
For i = 0 To 6 ‘ create 7 colums in the row
list.Add(New DataColumn(i)) ‘create the new colum
dt.Columns.Add(list(i)) ‘ name the row as the value of i
Next
For i = 0 To 200 ‘ now create 201 rows and add them to the table
Dim myRow As DataRow
‘ Create a new DataRow.
myRow = dt.NewRow()
Dim z As Integer
For z = 0 To 6 ‘ put data in each colum
myRow(z) = i
Next
dt.Rows.Add(myRow)
dt.AcceptChanges() ‘ accept the changes in the table
Next
dt.AcceptChanges() ‘ accept the changes again, just in case
DataGrid1.DataSource = dt ‘ set the datasource of the datagrid to the table
After reading the code, I think there could be a quicker way of doing the following code:
For i = 0 To 6 ‘ create 7 colums in the row
list.Add(New DataColumn(i)) ‘create the new colum
dt.Columns.Add(list(i)) ‘ name the row as the value of i
Next
Replace the code with:
For i = 0 To 6 ‘ create 7 colums in the row
dt.Columns.Add(New DataColumn(i)) ‘ name the row as the value of i
Next
Not sure if it speeds up anything, but in theory it should. You could also remove the list variable. Hope this helps someone!
[Update] When i used this i was using it in a webservice, and the web service would not let me return a datatable for some reason. so, to solve this problem, you must return a dataset. The following code works well.
Dim
ds As New DataSet
ds.Merge(dt)
this code creates a dataset, merges the datatable into it and then all you have to do is return the datatable or use it and your grand. Hope this helps someone!
More Posts
Next page »