Sunday, June 20, 2010

.NET API for PasteHTML

PasteHTML is a website which lets you upload and share HTML pages. It's free, anonymous and without registration. The uploaded pages should stay online forever.

The only drawback is that you can't edit or delete your uploaded pages in an easy way yet. It is ad free, but I guess there will be some advertisements in the future when hosting costs increase.

You can make a POST request to upload a page through their public API. I made an API for .NET which encapsulates building the url, making the request and parsing the response. This API makes uploading pages to PasteHtml through your own website or program child's play.

Example

   1:  PasteHtmlClient client = new PasteHtmlClient();
   2:   
   3:  PasteHtmlRequest req = new PasteHtmlRequest()
   4:  {
   5:       InputType = PasteHtmlInputType.Html,
   6:       Text = @"<div class='box'> 
   7:                <h3>The standard Lorem Ipsum passage, used since the 1500s</h3> 
   8:                <p>Lorem ipsum dolor sit amet, consectetur..</p>
   9:                </div>"
  10:  };
  11:   
  12:  PasteHtmlResponse resp = client.PasteHtml(req);            
  13:              
  14:  System.Console.WriteLine(resp.Url);
  15:  System.Console.ReadKey();           

In this example the PasteHtmlResponse.Url property returned http://pastehtml.com/view/19tfe0n.html.

Assemblies, source and your opinion!

You can download the API's Alpha version here. Play with it, take a look at the source and let me know what you think!

Update (22/10/2010): Fixed the download.
Update (24/07/2011): The project is now on Github!

Saturday, June 19, 2010

Making my blog suck less

Today Scott Hanselman did a session on blogging at the BWB (Blogging While Brown - yah seriously!) conference. He tweeted a link to the slides of this session. I embedded the slides in this post, but you can also get them from here.

Take your time to check out the slides. It's actually a bit of a checklist, so it shouldn't take more than two minutes.



The slides pointed out a few things that were missing on my blog..

Have your contact info somewhere

First you could only reach me through Twitter. Now you can directly send me an e-mail through my blog. I used Kontactr.


Have an About Me page

I added an About Me page. It is short and concise, but I plan on upgrading it in the near future.


Integrate Search

I added a Google Search widget, which should make it easy to search my blog.


What about you?

Do you have any feedback on the changes? Are there things you are able to improve on your blog?