It’s been a while now since there was a new release from CrazyBeaver Software so I thought I should make some fuzz about it and talk about it here as well.
A few weeks ago a friend of mine asked if I knew any way to save a video from YouTube onto his harddrive so he could use it in his school presentation. A quick search on google turned up few services that could download the .flv for you which was pretty neat though not enough since it would require that the schools computers could play .flv, which they can’t. My idea then was to make a simple wrapper for FFmpeg (a great open-source tool for recording and converting audio and video streams) and let him use that for conversion. The goal at this time was to make it easy for him to do this without my help in the future and maybe to let my other classmates do it as well. It worked out pretty well in the end and I now have a really neat C# wrapper for FFmpeg.exe which I hope to release some day for everyone to use. It was however not really satisfied with this, my application only did half the job, and the easy part was what was missing. I went looking around the net a bit for solutions on how to download the .flv-files from YouTube and found several ways which had their advantages and drawbacks. In the end, I borrowed a few ideas from most of them and got my own working solution for getting the .flv-files.

The result of this was the brand new CrazyBeavers YouTube Downloader which was released yesterday as version 1.0 and earlier today as 1.01 (just love the early bugs, so simple, so devastating). I’ve seen another program out there that does the same as mine but seeing the page I found it on i didn’t really want to download and run that .exe so hopefully this will be of use to more then just my class now.
With this release I also returned to NSIS (NullSoft Install System) for the installation which works a ton better then the Visual Studio setup projects I’ve used for BeaverSFV. I’ve scripted it to check for .Net 2.0 and if not it will download and install it. It also checks if the system is x86 or x64 to decide which package to get. Hopefully I’ll get around to discuss that one some day as well since it turned out really great. But until then, enjoy my new application!
Recently while building a small application for a friend of mine I came across a part where I needed something that I just couldn’t find in the .Net framework. I needed to upload two files (and specify their fieldnames) and a few form fields to a webpage. I thought this would be easy just using the provided WebClient class but after looking closer at it I found that it didn’t really offer anything of what I needed. Trying not to feel let down by this I started to write my own extended version of WebClient with a few new tricks that the old one couldn’t do.
I tried to keep it as simple as possible so instead of writing new classes to hold form and file data I used two Dictionary<string, string> to pass the values. The Key is the fieldname and the Value the value or the path to the file. An example of uploading a few files and adding a few fields to that could look like this:
It doesn’t look that hard does it? It’s perfect to use if you need to “submit” a form on a webpage from your c# application or just need to send several files to a webserver in the same request. Below is the complete code for WebClientEx displayed. You may use it for anything you want as long as you don’t claim it as your own. If you use it in a project of yours then please write a comment or send me an email about it!
I won’t go in explaining line of this code as I’ve done in a few other samples. The code isn’t that hard to understand if you have moved beyond the “beginner stage” of coding. The thing worth mentioning is the part with MimeHelper.GetMimeTypeForExtension() which is a small function I wrote which checks the registry for any available mimetype for a given extension. I’ve included that code below aswell since it’s needed for WebClientEx.
Enjoy!
It’s been quiet around here lately. I moved to a new apartment a bit over a month ago now and won’t get an internet connection for at least another month it seems so things are going a bit slowly on the development front. I’ve managed to put together a few things though which might be of help to some.
First of all is a .Net library (and client) for working with DynDns services named DynDnsLib (and CrazyBeaversDnsUpdater for the client application) for people who want to add support for DynDns services to their applications. More information (and sourcecode via SVN) can be found at the link below.
http://beaverdnsupdater.devjavu.com/
Second up is an implementation of the Akismet (spam detecting service that WordPress and a few others use) API for .Net 2.0. It is a quite basic implementation that could be extended a bit more if someone wants to but it should be working fairly well as it is. More info (not much) and source at the link below.
http://akismetlib.devjavu.com/
None of these projects are in their final version, but both works fairly well at least. If anyone want to contribute to any of these projects then send me an email to karl.sjogren@gmail.com and tell me what you want to implement/change and I’ll consider giving you write access to the SVN repository.
When thinking about it, checking out source from an SVN repository might be a bit tricky unless you know what you are doing, maybe I should put together an article for that aswell some day if people seem to want it.