Monday, 23 November 2009

IntenseDebate is a great free blog comments system. Here's a bit of LINQ to XML VB.NET code that will get posts from your blog that have recent comments. IntenseDebate offer a JavaScript version that will show the most popular posts over all time, but the problem with this is that it's not very customisable, doesn't allow for any ASP.NET caching and if a post gets a lot more comments than any others then it will always be at the top of the list, ignoring more recent post comments.



Share this webpage Comments on this webpage

Thursday, 21 May 2009

For my new 'live' section of my website I decided to use Google Calendar to manage the events and ASP.NET with LINQ to XML to display the events on my site. Getting the right syntax turned out to be a bit tricky, so here's some code that I came up with that should do the trick:

Dim myDT As New DateTime()
myDT = Now

Dim strStartTime As String = ""
Dim strEndTime As String = ""

strEndTime = Left(myDT.AddMonths(12).ToString("s"), 10)
strStartTime = Left(myDT.AddMonths(-1).ToString("s"), 10) 




Share this webpage Comments on this webpage

Monday, 20 April 2009

The blog system I'm using has a Twitter widget that can be added to pages to show your latest tweets. I wasn't quite happy with it so here's a simple Twitter status ASP.NET user control that I put together using LINQ to XML and VB.NET.

The control gets the two latest tweets and caches them for 60 seconds. Just change the .Take(2) line in the LINQ if you want more or less tweets and the OutputCache tag if you want more or less caching. There's a VB.NET function to add hyperlinks to URLs and usernames and a Javascript function to format the time of tweets.

Here's the .ascx file:



Share this webpage Comments on this webpage