Monday, 22 October 2007

Subsonic (.net ORM)


Not much content here. Just want to say that if you're still writing your own data access layer, stop now and head on over the SubSonic site and start using the easiest ORM I've ever had the pleasure of messing with...

10 minutes into TellyBook and I had my whole DAL up and running. Didn't have to write a single stored procedure or 1 line that said "... command as new SQLCommand(connection, "BlahBlahBlah")..."

I certainly won't miss that. Their site is full of useful articles and webcasts that really do mean you can just plug this thing in and get moving with it.

Props to Rob Conery and the rest of the guys.


And it looks like soon SubSonic may have rails style validation (Directly added to the generated model):

SonicCast - Validation



Argotic : Turning an RSS Feed into a list(of T)

Now then,

Managed to find some useful RSS feeds of various channels (mainly BBC, but it'll do for now) from the good folks here:

So thats the first complication dealt with... no screen scraping for me.

I then set about turning the feed into a collection of Programme objects. I'd heard about Argotic Syndication Framework a while ago so I decided to give it a shot.

Initial thoughts are... nice and easy to use and it just seems to work...

The code I'm using at the moment:

Dim pList As New System.Collections.Generic.List(Of TellyBook.Programme)()
Dim feedUri As New Uri("")
Dim feed As RssFeed = RssFeed.Create(feedUri)

For Each item As RssItem In feed.Channel.Items
Dim p As New TellyBook.Programme
p.Title = item.Title.Substring(6, (item.Title.Length - 6))
p.Time = item.Title.Substring(0, 4)
p.Description = item.Description
p.Channel = c.Name

If p.Time > currentTime Then
End If

That was simple. So... here's the breaks. Got an RSS feed you wanna turn into a collection of objects, give Argotic Syndication Framework a go....

Experimenting with facebook


I wanna experiment a bit with facebook apps, so I've decided to make a simple app which for the time being I'm going to call Tellybook.

The basic idea is as follows: I scrape /find RSS feeds / somehow get hold of... TV and radio listings for the major channels in the UK. I'm then gonna check out the facebook user's favorite films, tv programs and music listings. I will compare the user's favorites against programs / films / live performances that are on TV and radio over the next few days and alert the user to what is coming up that matches their entries...

The idea will probably grow as I build the thing, but I think this is a good starting point...

Technologies I plan to use:
ASP.NET and SQL 2005 for the code bits.
Subsonic for DB access
JQuery for any AJAXy / trendy stuff
facebook.dll - FB developer toolkit
Argotic - for turning RSS into objects (if needed)

this may change as the project moves forwards... we'll see