. Topicala Page Index Token

A Journal about the experiences I have developing little applications in C#, Perl, Html and Javascript and talking about things new things that I use. Always Geeky; Always Nerdy; Always poor Grammer!

I am a Software Analyst Developer working in Southport, England but living in Liverpool. I develop mainly in C# and ASP.Net. I have been developing comercial software for several years now. I maintain this site (hosted at SwitchMedia UK) as a way of exploring new technologies (such as AJAX) and just generally talking about techie geek issues. This site is developed through a host of Perl scripts and a liberal use of Javascript. I enjoy experimenting with new technologies and anything that I make I host here.

Quick Search

Web www.kinlan.co.uk

Saturday, April 23, 2005

Amazon Web Service

I have just done a little test to see if any of my ideas are any good.

Here are the results of my first test.

Wednesday, April 20, 2005

Visual Studio 2005 Beta 2

If you are somehow living under a rock you may not have noticed that Beta 2 for Visual Studio 2005 is available to download for MSDN Universal subscribers. I have been following the development not too closely, but enough to be excited by this news!

I hope to have some examples of stuff soon :)

Monday, April 18, 2005

Are there any good Web Services out there?

Because I have been playing with Amazons web service, I was wondering if anyone else knew of any other good web services out there.

Specifically I am looking for UK based retail Web services like Amazon, a Tesco, Asda or Virgin etc one would be great. But any will do, I am finding it hard to find any decent easy to read resources on the Internet :) And that UDDI stuff, sheeeesh! :)

If anyone has any information on these can you post them in the comments. I would be greatful, I will report any findings as I see.


Retail
  • Amazon: Quite good but I might ask for some features
  • Ebay: Not too sure, don't really want to pay for it :)

Search Engines
  • Yahoo: Very good little REST API, I like it so far
  • Alexa: Not tried it but it looks okay, I think it is based around the Amazon API
  • Google: Not Tried it yet.

Companies I would like to see publically available API's for

  • Tescos
  • Asda
  • Dixons
  • Commet
  • Game
  • Waterstones
  • Kelkoo: Not really a retailer, but I have some ideas
  • Virgin Megastores
  • HMV
  • Easy Jet,
  • Ryan Air
  • Play.com

The list goes on.

Sunday, April 17, 2005

Iterating Accross A Users Links in c#

One thing I have been looking at recently is how to access the Users Internet Explorer Favorites.

I managed to find two resources somewhere, one was c# to find the favorites and the other was VB.Net code which parse the *.Url file.

I have the code below (tv is a Tree view on a form):

...
DirectoryInfo di = new DirectoryInfo(
System.Environment.GetFolderPath(
Environment.SpecialFolder.Favorites ));

EnumerateFavorites(di);
...


The above code will get the directory information about a users Favorites. The Static vairable "Environment.SpecialFolder" contains some other very usefull locations. My Computer, My Network etc.... I think :)



private void EnumerateFavorites(DirectoryInfo dii)
{
tv.Nodes.Add(dii.FullName);
int i = tv.Nodes.Count-1;
foreach(DirectoryInfo dI in dii.GetDirectories())
{
EnumerateFavorites(dI);
}

foreach(FileInfo fi in dii.GetFiles())
{
string URL = GetUrlFromLinkFile(fi.FullName);
tv.Nodes[i].Nodes.Add(URL);
}
}

private string GetUrlFromLinkFile(string file)
{
StreamReader sr = null;
string content;
if(!file.EndsWith(".url"))
return "";

try
{
sr = new StreamReader(file);
content = sr.ReadToEnd();
}
finally
{
if(sr != null)
sr.Close();
}

if(content.Length == 0)
return "";

int startI = content.IndexOf("URL=");

if(startI == -1)
return "";

startI += 4;
int endI = content.IndexOf(
Environment.NewLine, startI + 1);

return content.Substring(startI, endI -startI);
}


What appears above is code that will Recursivly iterate into any Folders that the user has defined for their Favorites. Some futher code will also parse the .URL.

The *.URL file is a basic text file (much like the AutoRun.inf file). One line starts URL=kinlan.co.uk etc. The function GetUrlFromLinkFile, parse this information and returns it as a string.

If I find the resources where I got this from I will give the credit where it is due.

One thing that is not available in the *.URL is the text that appears in the Internet Explorer Favorites menu. For example www.microsoft.com might appear as "Microsoft" in the Favorite menu. If anyone knows how to do this in c# let me know (I would be greatful). I have a feeling that it might be something to do with IShellLink, but I am not too sure, nor am I any good with Interop [at the moment, I will have to learn]

REST and SOAP

I have been playing with Amazons SOAP API as well as Yahoo's REST API. I really like both of these API's. I will talk about some ideas I have for letting both of these API's interact in a later blog. :)

I was looking into using REST in .Net 1.1, it was a bit of hack but it is based off Martin G. Brown work. The basic steps are to download an XSD for the response package. Pass it thorough the XSD.exe tool which will create a Dataset based object which mimics the results. You can then get the results and process them however you need.

Basically we are doing something similar to what WSDL does (obviously we are not creating stubs that WSDL does for the serialization and the communication process). But it is not too hard to start the communications off. [I will include some code examples for Yahoo].

I am yet to look into Googles API, supposedly it is still a Beta with quite a strict usage limit. But hey, it might change! :)

MSDN .NET Framework Developer Center:

I just realised that I never followed my own advice to watch the videos on MSDN. I just watched
Designing .NET Class Libraries: Member Types and I have to admit, this guy talks sense :)

Even though I have done a lot of c#, it is very interesting what "the" people talk about and their basic standards. I liked his arguments for cohesion of overloaded methods. I think I will try and follow that advice.