Lukášův bloček

Random photos, thoughts and notes 

One slice is not enough

This week, I'm looking after two rats at my workplace. Today, despite being warned against this, we made a mistake of leaving a single slice of bread on the floor for them. Unfortunately, the first one to notice wanted the whole think for himself. This soon caught the attention of the other one (who was hidden somewhere until then and completely out of sight) and a fight was inevitable :-(

(download)

Needless to say, we won't do this again next time!


Filed under  //   rats  

Comments [0]

Posterous API for C# (and VB.NET)

Let me introduce my latest creation - Posterapi - a C# wrapper for Posterous API, complete with source code and samples!

Few months ago (see here), I discovered there was most likely no usable and free C# wrappers for Posterous API. So I decided to write one myself. It took me two months, but the first beta has just been released today

Check out Posterapi homepage and sample code for more information, or just download the latest binaries and samples or the source code (MIT-style license). All currently available features except Posterous Twitter API are implemented (let me know if you would like to have that as well).

To publish a new post with 2 photos, a simple code like this can be used:

    // Initialize an authenticated posterous session
    PosterousSession session = new PosterousSessio(email, password);

    // Construct a new post and attach two photos
    PosterousNewPost newPost = new PosterousNewPost();
    newPost.Title = "New post!";
    newPost.Body = "This is the body of the new post.";
    newPost.Tags = "posterous, api, photo";
    newPost.Files.Add("photo1.jpg");
    newPost.Files.Add("photo2.png");

    // Publish the post to the primary site (blog)
    PosterousPostInfo postInfo = session.PublishPost(0, newPost);

    // Display some information about the new post
    Console.WriteLine("Published as {0}", postInfo.ShortUri);

There are more samples - even a GUI posting application that is very useful for posting long videos that are not really suitable for e-mail submission.

I have to say that Posterous API doesn't really make it easy to put a nice .NET API on top of it. The available methods seem to be a random selection of its functionality. Some key functionality (at least in my opinion) is missing. Some examples:

  • Even if you know an ID of a single post, you can't easily download it.
  • If you know its post.ly shortcode, you can only download it if it's public - even if you are authenticated.
  • You have to know a Posterous hostname of a site to be able to download its posts. If you only know its custom domain (like lukas.pokorny.eu), there is no way to determine its Posterous hostname (pokorny.posterous.com).
  • Only "basic" authentication is currently available. This is not secure because the password is transferred in near-plaintext.

This means that if you feel that some part of Posterapi is not pretty, it might not necessarily be my fault ;-)
Of course, if you find something you really don't like or if something is not working as expected, please let me know. This is still a beta and I only tested the features I actually need. Report all the bugs here.

If you find this useful, please let me know!


Filed under  //   C#   posterapi  

Comments [10]

Foggy wood on New Year's Day

Let's hope this year won't be as foggy as its first day!

       
Click here to download:
Foggy_wood_on_New_Years_Day.zip (357 KB)


Comments [0]

Sign of Satan stolen from St. Agnes Home

The 666 sign, or the number of the Beast, was stolen from a house at Lublaňská street in Prague. To make this even more amusing, the building itself houses "Domov svaté Anežky", or "St. Agnes Home"!

     
Click here to download:
Sign_of_Satan_stolen_from_St._.zip (135 KB)

The first photo (with the sign still present) comes from Google Street View, I hope they don't mind.


Filed under  //   666   fun  

Comments [0]

How do I get post.ly URLs of my posts?

I noticed that people who don't use Posterous' autopost functionality are using various third-party URL shortening services when manually linking to their posts. At first I thought that it's quite strange since Posterous has it own post.ly service, but I soon realised that shortened URLs for my existing posts are nowhere to be found.

But then I discovered that each Posterous post does in fact have its own post.ly URL, although it's only available through Posterous API. For example, to get post.ly URLs of my posts, enter http://posterous.com/api/readposts?hostname=pokorny into your browser and - voila! - the post.ly URLs appear. Simply replace my my name with your own hostname to get your posts as well.

Even though this works perfectly, I have found out that it is quite frustrating having to search the whole XML for post.ly URL of older posts. To make it even simpler, I have simply wrote a tiny application that does it for me - the post.ly helper! Now, all I have to do is type in a Posterous hostname and I get the list of my posts with post.ly URLs back.

This is simply too good to keep only for myself, so if you find it useful as well, please let me know.


Comments [1]

Galway cathedral

Another set of photos from 2003. The interior of the cathedral in Galway looks like it was rendered by a computer program, but it's real. In the 1960s, Brian Trevaskis called it a monstrosity on TV, which was shocking at the time in Ireland.

           
Click here to download:
Galway_Cathedral.zip (448 KB)


Filed under  //   travel  

Comments [0]

Jesus and the breakfast barbecue

Really, Jesus can do anything, at least in Dublin. Another amusing old photo from our visit to Ireland in 2003.


Filed under  //   travel  

Comments [0]

Howth Junction, the most boring place in Ireland?

I spent 40 minutes there 6 years ago, waiting for a train and wandering around. There was nothing interesting at all. And nothing to do - even golfing was prohibited! But surprisingly, this place has its own page at Wikipedia now.


Filed under  //   travel  

Comments [0]

How to get rich fast

How to get rich fast? If you are living in a country like Vietnam where copyright law is just for fun and you know how to write software, it's rather easy:

  1. Purchase a source code to some commercial software components.
  2. Rename all namespaces, methods, properties, etc.
  3. Throw away the samples and write new ones.
  4. Compile, repackage and sell as your own work!

But what if someone finds a bug or needs to solve some complicated problem? Well, that's very easy to solve:

  1. Generate 10 fake names and get free e-mail accounts for them at Gmail, live.com or Yahoo.
  2. Send the complicated support request to the real vendor using one of these fake identities.
  3. When you get response, pretend you wrote it yourself and send it to your customer. Problem solved!

And to make it even more efficient:

  1. Pretend you are a US-based company. Get a virtual office.
  2. Pretend to have some additional seldom-used features no one really needs.
  3. Search various forums for links to the original vendor's products and add your own to save time.
  4. If someone asks you about the similarity, pretend there is not any or just ignore them.
  5. If you can no longer ignore them, pretend you outsourced all your development and support to China and didn't know about any infringement :-)

Does this sound too far-fetched? It sure does. But it's exactly what a company (?) called ComponentForge or Safabyte did! Check out the website about ComponentForge/Safebyte scam if you are interested in details.


Filed under  //   work  

Comments [1]

Podivuhodný Ind

Ind má 12 prstů, 84 centimetrů, 35 let se nemyje, živí se trávou a popíjí benzín. Za ženu si vzal fenu, svatebčany upálil a své dcery posílá orat nahé. Patnáct let trucoval na stromě a upálil se, protože nedostal k večeři maso. Šest let čekal v hrobě na smrt a pak se bezostyšně dostavil na svůj vlasní pohřeb.

Už mnoho let si v novinách všímám podivných historek, jejichž protagonistou je jakýsi Ind. A dějí se mu naprosto neuvěřitelné věci. Nashromáždil jsem už tolik odkazů, že by to vydalo na blog, takže tady je: Podivuhodný Ind! Jakékoliv další příběhy tohoto Inda jsou vítány!


Comments [0]