Wednesday, September 19, 2007

Five US citizens seeking asylum in Finland

This news was ignored in foreign media, so I guess I have to translate it.

"Finnish border officials were amazed when five US citizens applied for asylum status yesterday evening at the Helsinki-Vantaa airport.

The applicants had arrived to Finland from inside the Schengen area and informed The Border Guard of their desire for asylum status. From here on the actual application process will be handled by Directorate of Immigration.

- In near history this is the first time adult US citizens have applied for asylum status in Finland, major Janne Piiroinen told reporters.

According to the information made available to reporters, the US citizens are part of the same group. Officially the reason of the asylum application is still unknown, but it is not related to protests of Iraq war."

Wednesday, August 08, 2007

Decided which Facebook app to make .. NEXT =)

This post is mainly meant for myself to organize my thoughts.

I finished my composing app mostly. I got around 200 people to install it, now I am waiting to see whether it is viral at all or not. Currently it is showing growth of 2% per day, but I'm not sure if it's really spreading at that rate, it could just be chance. Would be wonderful if it were true, because 2% increase per day is over a thousandfold increase per year. Personally I think the app sucks, but I've seen other apps get popular which suck even more, so I guess it's not totally impossible ;)

My friend made a great suggestion for the subject of the next app -- one which would let people take and make tests. It seems extremely viral, because it has two ways of spreading. Firstly, if a user creates a test, it seems very likely they would send it to their friends. Secondly, people always like to share with friends their test results and encourage them to also take the same test, so that the results can be compared. I'm amazed nobody has made this kind of app yet. I might feel paranoid about sharing this idea, but luckily nobody except you reads this blog.

There are tons of different types of tests, so I am now trying to decide which ones to include and which not. For example there are IQ tests where the question and possible answers are images ("which picture comes next in this series?"). Then there are knowledge tests where the question and answer are text ("what is the capital of Japan?"). Also there are image recognition quizzes ("which Simpsons character is this?") where the answers are text. Rarer, but possible would be reverse image quiz, where the question is text and the answer a multiple choice out of a set of images. Then there are multivariable quizzes which are a bit more complex ("answer this set of questions to discover which 24 character you are"). I think I came up with a way to create even multivariable quizzes that isn't all that confusing ...

Those were the different quiz types I could come up with, but there are also some features that could be included or left out. When answering a question, sometimes in quizzes additional information is provided about the correct answer ("what is the capital of Japan?" - "Tokyo" - "correct, did you know Tokyo is blah blah"). There could be time limits when answering. In addition to getting how many percent were correct, sometimes there is textual feedback ("80% - very good"). The questions could come in a predetermined order, or at random.

On implementation side the normal way to do this would be a straightforward HTML (well FBML) interface, but to make it faster it could be done with Flash or javascript. It's kind of annoying to wait for page loads after each question. I have done some scripts like these before, and the biggest problem I had was keeping track of which questions have already been displayed to the user (when random order) and making sure that no duplicate options are included in multiple choice questions. Why is that tricky? Well suppose there are two questions "what is the second largest city in the state of New York?" and "what type of animal is the wild Arni?". Both of the answers are "Buffalo". This means that randomly chosen multiple choice answers could contain two identical answers with different meanings, which should be avoided.

Friday, August 03, 2007

App mostly finished

Alright, I worked hard for a week straight and managed to finish the Mini Mini Melody application for facebook. Please follow that link and install it if you have a Facebook account, then send me some feedback!

Wednesday, August 01, 2007

Tay Zonday, tour for us!

Dear mr. Tay Zonday. You rule. For now. People want to see you, but soon they will forget. That's the fate of an Internet star. So go along with this, live your "Internet dream". See the world. Make a zillion dollars in the process.

Let go of the hesitation.

Monday, July 30, 2007

Totally tired with this app

I'm exhausted! I've been working on this melody Facebook app for around a week now. At first it was very exciting. I had big dreams of making a hugely popular app, but now that the app is becoming more concrete it is starting to become obvious that this will be marginally popular at best. Why? Well, turns out it's a lot more difficult to express yourself with music than by drawing!

Currently in the app you can selected between a piano, a cat's meow, a dog's bark, human voices or drums. The app allows you to make a very short composition, around 30 seconds at the longest perhaps. There is a staff on which you can place notes to make your tune. I haven't done the sending part completely yet, but the idea is that you could send these tunes to your friends.

The path from an idea to reality is always less smooth than one would hope. An idea is very vague. Even if you try to work out an UI on paper, it's still vague, even if you don't know it. There are just so many little details that you will never be able to think about until you make the app. And that's fine, because making the app is all about describing those little details to the computer anyways. I'm struggling to provide a concrete example here, but for example in this case the idea was "a graffiti-like app for sending melodies". Then in the paper UI mockup I realize that there has to be some way to put different instruments on a staff. Then when really trying to make it, I realize that when you are placing those instruments, there has to be some kind of indicator of what you are selecting. But that indicator shouldn't be shown if you are outside the area ... and if you select drop-down menus they should appear ABOVE all the notes, not below. And a million details like that.

After you spend days just basically tangled with these small details, you become very exhausted even though from previous experience you knew that it would be like this, while of course secretly hoping that this time would somehow be different. There is some satisfaction in seeing your idea become a reality, to interact with what you have created, but at the same time you have to face the depressing reality that perhaps your idea wasn't as great as you had hoped. What seems like a fun idea often isn't as much fun in reality.

A tale of two Graffiti

If you use Facebook, you have probably used or at least seen the Graffiti app, which makes it possible to send doodles to your friends. But did you know that there are actually two different Graffiti apps? One wildly popular (5,713,050 users and counting) and another more obscure one (mere 11,367 users). Surely the one with less users is just a clone? No, according to the creators, the more obscure one came first.

I remember installing the more popular one and instantly writing graffiti to my friends, which was kind of fun for a while. Out of curiosity I installed the more obscure one as well, but the thing is that I can't figure out how to use it. It keeps showing error messages. The lesson here of course is that it doesn't matter how cool your idea is -- if it doesn't work or the users can't figure it out (which amounts to the same thing) then it will never be popular.

The creators of the original graffiti must be kicking themselves now...

Saturday, July 28, 2007

Melody app progress

I have been actively working on the melody app lately. Learned basic Facebook API usage and started making the UI part in Flash. Progress is nice, I can already arrange piano and drums on the tracks. A surprisingly difficult thing has been trying to find the different sound samples to use.

I need at least a basic piano sound, a guitar sound, drums and some funny sounds. The temptation is great to go to one of those "free samples" sites to grab something, but I want to be sure that any sounds I use are properly licensed. So instead I have been trying out sites where you can download sample packs. I am really surprised at the poor quality of the sites and the sounds they provide. For example some drum hits might have an audible hiss in the background, in some cases almost to the point of being static. Finding drum loops is easier, but I want single hits, not loops.

Come on, I just need around 28 different sounds, hopefully for under $100 total. How hard can this be?

Wednesday, July 25, 2007

Decided which Facebook app to make

The idea that found its way to the top of my ideas list (it's a long list!) is a music composing app. Basically like Graffiti, except that instead of drawing stuff, you can compose little musical pieces and send them to your friends. You would do this by arranging notes on a small staff (the classic "like X except Y" pitch). Taking Graffiti as the inspiration, everyone would have a wall of composed musical pieces.

What I am concerned about a bit is the bandwidth. I wouldn't even be doing this if I didn't intend it to be popular. So assuming it is popular, perhaps people would be loading the composing/playback Flash application about 100k times per day. I did some calculations in my notebook (in a section titled "slimy biz talk corner") and this could mean a bandwidth cost of about $600/month. From my prior experience 100k page views per day for random people isn't necessarily greater than $600/month, so it might be that initially this makes no sense. However bandwidth is getting cheaper, and with Flash 9 there are things that would let me cut the size of the player/composer down A LOT so perhaps it would make sense in the future if not right away.

Oh yeah before settling (at least for now) on this idea, I spent two days basically pondering nonstop about which Facebook application to make. I wrote a long list of ideas that occurred to me, then ranked them based on how promising they seem. It's funny how many ideas for social apps you can find by reading a book containing playground games for children. For example there was a game where you must come up with something that you have done, but none of your friends have done. That would make a nice app as well. Anyway the point is that playground games books are a great resource =)

Sunday, July 22, 2007

But what to develop?

I have been trying to come up with something to create for Facebook, but how to know what is worth spending a week of development time on? Some criteria I have come up with:


  • Coolness - If a potential user encountered this app all alone, with just a few sentences to describe it, would they likely be excited about it?

  • Virality - How likely would they tell their friends about it?

  • Monetization - How much money does each user translate to? Sometimes the right crowd (people wanting to install awnings in their home) is better than a big crowd (people looking for free software).

  • Stickiness - How likely would they use the app for long periods of time?



It's interesting to think about the top Facebook apps in these terms.

Top Friends - Slightly cool, very viral, not very monetizable, not very sticky.
Graffiti - Very cool, not so viral, not very monetizable, pretty sticky.
iLike - Cool, viral, monetizable, sticky.
... and so on

Developing for Facebook

Easiest hello world I've ever made was in Commodore 64 basic. The most difficult one was with Symbian -- I never had the patience to finish it! Facebook seems to fall much nearer to the C64 experience. Starting to develop a Facebook app feels really sweet. Seeing what you create instantly embedded on a major site is a strange feeling, because it's something that's completely new.

The thing I was most confused about at first was how the content you create would find its way to appear on a Facebook page. At first I figured that code must somehow be running on Facebook's servers, like in a sandbox. But it doesn't work like that, rather Facebook calls your server and displays the response it gets as part of the page it renders.

One surprise was that things are a lot simpler than you would expect. The PHP API include file is just around a thousand lines of code! I feel that now is the time to get in the game of building Facebook apps, because certainly after a while they will add a zillion new things you can do with the platform, which will make it even better, but also that much more confusing for those just starting out.

In my mind Facebook has won. With all the apps that have been created and are being created, Facebook will have thousands of times the functionality that MySpace is offering. The change in Facebook has been so sudden that people have not yet realized what happened, it will take a while before people understand that there are now these things called "apps" and that you can add them to your profile. People will gradually learn, and a few of those apps will be such gems that people will wonder how a social network could ever be considered complete without them.

Monday, July 09, 2007

Would you pay $10 per gallon?

Sweden is considering meeting its goal of reducing emissions by doubling the price of gasoline by the year 2020. This may raise the price of gas in Sweden to over USD $10 per gallon (2 euro per litre). Sweden has promised to lower their carbon dioxide emissions by 20 percent by the year 2020 and according to calculations the price hike would cause this goal to be met.

This news seems to have been ignored by the English media, so this was a quick translation of the source articles.

Saturday, March 24, 2007

Daniel Tammet

I read the book Born on a Blue Day, which is about a savant called Daniel Tammet. I got the book after seeing the documentary "Brainman" on YouTube. The name of the documentary is a word play on the famous movie "Rain Man", where Dustin Hoffman plays an autistic savant. The documentary is over-dramatized, but by concentrating my attention only on the interviews it was an interesting watch.

In the Brain Man documentary Daniel Tammet describes his number synasthesia. "Synasthesia" means the property of associating two seemingly unrelated senses with each other. In the case of Tammet his synasthesia manifests as seeing numbers in different shapes, textures and colors. We might see the number "117" as a boring compination of three digits, but for Tammet it is a very distinct visual object. By using these associations he was able to recite 22,514 decimals of the irrational number pi without a single error. He also has some enrichened sense of words, which enabled him to learn the icelandic language in a week (to some level).

After seeing the documentary I had this image of a super-intelligent person, devoted to mathematics and indifferent to what others thought about him. In his book I discovered a different kind of Tammet however, one seeking acceptance and trying to fit in, all the while having trouble with small issues in life, such as brushing his teeth. A person not single-mindedly devoted to numbers, but one with a personal life with his husband Neil, staying at home cooking meals for him out of materials grown in their own garden. Crying over their dead cat. For Tammet numbers aren't the sole content of his life to the level I had imagined. In his book he hardly talks about numbers, rather concentrating on describing his exchange study in Lithuania and his attempts to be a part of the world which surrounds him.

However precisely because the book was so different from my image of Tammet, it was a very refreshing read. Without realizing it, I had this stereotypical image of what a savant "should be like". Real life is not just numbers, it is about having a daily life which you can feel content with, it is about fitting in, making friends, being accepted. Savant skills for him were not only a gift, but came with significant downsides as well. He had to try hard to make it in the world, but seems that he succeeded.

Thursday, March 08, 2007

AdSense - things I love and hate about it

  • It tempts me to create spammy sites which provide no actual value to the visitors, that in turn makes me feel superficial, greedy and in turn unhappy. My most embarrassing secret: I have actually made a page about mesothelioma once. No more! Valuable content and functionality only! (yeah yeah)
  • It never pays enough. I console myself with the thought that my AdSense ads still make me more than the daily average in some super poor nations, but on the other hand at times I feel like I've worked for that money as hard as someone in a super poor nation (okay not true).
  • Sometimes it displays really unsuitable ads and it angers me that I cannot just tell it what types of ads to display and instead have to rework my content to help AdSense guess better. Example: I wrote a page about how to create objects using a toolkit for a computer game, using a beer bottle as an example of an object you could create. Of course, now AdSense is displaying ads about beer, not about games. Grrr.
  • Spending countless hours excitedly monitoring my pathetic AdSense revenue and click-through rates. Wow, I made $1 today! Hooray! (what?)
  • Moving to a different country requires you to close your AdSense account and open a new one, accumulated funds are saved in the process but it still feels like an unnecessary hassle.
  • The fear that my account would suddenly be closed, without any explanation, with all my funds frozen and not getting an answer when I ask why (apparently has happened to people who at least claim to have done nothing wrong). Not sure if this issue is real, but the fear is, and Google doesn't seem to be very open about it.
Time to get positive...
  • It is a real joy to set up, copy & paste goodness.
  • It provides a somewhat predictable revenue stream when contemplating about starting new sites, a real enabler for webmasters everywhere.
  • It gives Google a lot of money -> Sergey & Larry seem to be into using some of it for space and artificial intelligence research -> I get to take a ride to a distant planet in an AI controlled spaceship and have an intense battle with the AI when it goes berserk midway.
EOF

Tuesday, March 06, 2007

Thank you Sierra for all the great moments

The first time I saw Space Quest 3 was at the house of the literally richest kid in town. I mean really, his dad owns a factory and even a a theme park! So they had this computer called the "PC", with a nice sound system and an expensive Roland sound card. I was standing there while he was playing SQ3 and I was blown away, not even really thinking I could ever own such a system myself.

Later I got an Amiga 500 computer, which looking back kicked the PC's ass when it comes to gaming. I was so happy that Space Quest 3 was available for it, now I could actually play it myself. Of course with all Sierra games there were several disks that you had to change during the game, and you often spent more time waiting for things to load and swapping disks than actually playing. I couldn't afford to get an extra disk drive, let alone a "hard disk" (I had read about those in a computer magazine, apparently it was a device that eliminates changing disks!).

Well, actually I once thought that the disk swapping might come to an end. In that magazine they were talking about this new type of disk, which is readable in a normal floppy drive, but could store as much as 10 megabytes on it. With that I could possibly store the entire game on a single disk and actually afford it! It was called "bubble memory", the technique was apparently that the data was stored as the state of a layer of bubbles on the disk. I was so excited I could hardly contain myself. Then I found out that it was an april fools' day hoax and... I cried.

The most emotional moment from playing Space Quest 3 was definitely walking around in a space scrap yard in the game, discovering something that looks like a ship, then actually getting it turned on and flying off with it! After that discovery I didn't want to fly off right away, but rather I called a friend over and we continued from there together. I think I was so excited I hit my head on my loft bed when getting up from my computer.

Thank you Sierra for all those great moments!

Monday, February 26, 2007

Microsites - progress with image quizzes

My PhpBB extension for image quizzes is coming along quite nicely. 18 hours, 657 lines of PHP and 250 lines of HTML later users are now able to create quizzes and take quizzes. Most headaches I had were session handling, I couldn't figure out how to do it properly with the session handling build into PHP, so I resorted to just passing stuff around in very non-SEOed (lately the word SEO makes me cringe) obnoxiously long URLs.

If I had tried to do everything perfectly then I would have never finished, I think it's important to get a first version out before polishing it too much, see what the users do and then improve on it. Obviously it should mostly work, and it does. Currently it's just in Finnish and I enabled it just on one forum to have a limited test. I hope that people will like it and that it would cause people to spend more time on the forum (which I'm not sure Google Analytics knows how to measure), maybe even get some new visitors that come just to take the quizzes.

One benefit I didn't anticipate from integrating with PhpBB was that it's possible to know who the people taking the quizzes are, so I can construct a scoreboard for them. People love scoreboards, it makes them want to improve their score over and over in order to not look bad. My plan now is to see the effect the quizzes have, polish the code a bit, then create a new PhpBB installation (actually all my installations are virtual, not actually separate instances of the software, using a mod I made) which is focused just on image quizzes and redirect my existing quizzes there.

I love the feeling of publishing stuff on the web, not knowing at all if it might be popular or not.

Monday, February 19, 2007

Microsites - extending PhpBB to support image quizzes

One of the features I imagined any fansite should have is a quiz of some kind to test your knowledge of the series in question. One popular site I have is a Naruto quiz, which I made one evening just for fun. Adding images to that quiz required me to edit things in the database manually and copy images into the image directory manually as well. I want to improve that by creating a PhpBB extension that lets forum users create their own quizzes by uploading images. I have several motivations for making this.


First of course that it is one of the planned features for the microsites I've been talking about for the past few posts. Secondly it allows me to easily create new quiz sites similar to the Naruto Quiz, which seem to easily become popular. Thirdly I can use the feature right away on the forums which I host and get people to make their own quizzes - I'm sure they'll be more creative than me and create kick-ass quizzes.

Tuesday, February 13, 2007

Microsites - Kickstarting a forum

In previous posts I have been describing my idea of using my online Japanese book & record store as a platform for kickstarting microsites around the bands / series sold, the theory being that if there is a popular microsite hosted under the site's domain and with a link back to the products being sold, this will attract customers and result in more valuable conversions than if the microsite was just a separate entity with AdSense ads or Amazon Affiliates ads on it (one purchase from my own store is A LOT more valuable to me than a purchase through Amazon would be).

I'm already very busy with my studies and running the web store as it is, so as the first easy part of the microsite experiment I decided to attempt to launch a forum around the band Antic Cafe. One thing I have learned is that people go crazy over prizes, so I decided to offer a prize to the most active person on the forum. In addition I dedicated some valuable screen estate on the store's main page to promote the forum. Here's what happened:

(162 absolute unique visitors)

The forum was promoted on the web store from the beginning. I marked the beginning and ending dates of the competition in black. It is clear that the competition had a major effect on amount of visits. The 11 members of the forum have written 147 posts up to now, which while modest seems like a good start for such a niche (Finnish fans of the Japanese band Antic Cafe) forum. I neglected to measure how many conversions this forum has created, but I'm not sure if that's even possible. Suppose a web store visitors goes to the forum, then comes back and buys an Antic Cafe record, is that a conversion? There seems to be no way to know if they got excited about the band on the forum or would have bought that record anyway.

I would like to launch the main microsite as well (this forum would be just one part), but I don't want to do that with completely pathetic production values. Also the forum might well be 80% of the microsite's value in the end, so why even bother with the rest?

Features I imagine that each microsite could have:
  • forum
  • polls (but forum already has polls...)
  • quizzes (can you recognize these members/characters from the band/series X?)
  • personality tests (which X are you?)
  • embedded videos (">veoh! youtube is so last year)
  • fanart submission, voting (maybe just a thread in the forum from which these are pulled?)
  • info pages for the series (through a wiki or pulled from forum threads)
  • news (perhaps an embedded RSS reader)
  • gallery (some clever system to get legal-size thumbnails linking to images elsewhere)
  • fan fiction
  • links (perhaps by automatically monitoring server logs for incoming links and favoring those)
Cool but impossible things:
  • exclusive band member / manga author interviews
  • exclusive content from the band / author
Perhaps most of these could use some embedded elements from other sites and would let me avoid actually coding them. If I could just find some good solutions for doing these, then I can use the same formula for a hundred different sites and save a ton of work compared to people who start single fansites for fun.

One option to consider might be to extend PhpBB to support these things. Perhaps there are already plugins for these? That would at least make it very easy to have just a single login that could be used for all of the microsites (since OpenID isn't here yet).

Saturday, February 03, 2007

Did some site reorganizing

I run a small village of microsites on different topics, it's sort of an experiment to see what sorts of traffic I can get. I had the domain jackvalenti.com, which I bought on a whim and set up an unofficial page about Jack Valenti there along with AdSense ads. Well, after spending nearly $100 on the site I am averaging ZERO visitors per day, so to avoid some site fees I am moving the content to a subdomain instead. From now on Jack Valenti page will be here instead.

Another more successful, but still an infuriatingly unsuccessful small site I had was a sweepstakes site. It runs on pligg and used to be in English. Every day I would check the stats on Google Analytics and every day I was getting around 200 visits, but nearly 100% from Finland through one nice inbound link I managed to get, so I will yield under the pressure and turn the site into a Finnish site to serve those visitors better. From now on it will be here: kilpailut.

One thing I have learned while trying to promote my sites is that people respond well to prizes. I had a forum that I was spending some promotion efforts on, but hardly nobody registered to that forum. Then I offered a prize for registering and posting on the forum and suddenly people (in the target group, not just prize scavengers!) started registering and posting. Prizes are expensive though, difficult to say if it makes sense to give them out. On a forum it is very important to reach a critical mass of posts at first, so it may help at that and possibly pay off in the long run.

Sunday, January 21, 2007

Microsites feature - forums

In my previous post I wrote about my intention to leverage the traffic I get to my online store to start microsites around product groups, such as different bands. I took my first step into that direction by tweaking PhpBB and doing some mod_rewrite trickery to allow me to easily create several forums which appear distinct, but are actually all running on the same software and database. This allows me to maintain only one installation of PhpBB and create a new forum in about 20 minutes instead of a complete new installation.

Obviously a microsite is going to need more than just a forum, but I imagine that for a successful microsite the forum would be the most important part of it. To test out the system I created two forums around two bands whose products I sell, Maruru forum and Antic-cafe forum.

Deciding scope


The reason for starting several small forums instead of one big one is to create a sense of belonging / identity for those using them. People seem to feel stronger attach ment to smaller circles. For example people will feel a connection to those attending the same school as them, at a lesser level to those living in the same city as them, even lesser to those from the same country. I want to find the optimal "circle size" to get people to feel that attachment, while not limiting fruitful conversations that could have happened if those circles were combined.

For example I could have created a "japanese music" forum instead of having "maruru" and "antic-cafe" as separate forums. Perhaps I should have, not sure, still experimenting. Certainly someone who is an enthusiastic fan of Antic Cafe would feel less at home at a generic forum for all Japanese music. Still there clearly has to be some minimum size at which an active forum is still possible, if there wasn't I could create a forum for people from Vatican who like Michael Jackson and are into cross-dressing. It would be a small group, but man would they be into it.

Wednesday, January 17, 2007

Microsites

I run a webstore, which means that I get very targeted audiences to my website. They will often even specify their interest by doing searches, or by looking at certain items. Mostly they are only looking, not buying, which is fine of course. Lately I have been wondering whether these targeted visitors could not be used to launch "microsites" related to certain products or product groups.

Take for example a person who searches for "dir en grey", then looks at products from the band dir en grey. Clearly they are quote interested in this band. Perhaps I could tell them "hey have you checked this fanpage for the band?". This could be a very relevant thing to say, and when things are relevant they tend to not be irritating. The trick of course would be that these fansites would actually be sites that I have launched myself (perhaps clearly indicated by being a subdomain of my site, say dir-en-grey.bemmu.com). They would become destinations in themselves, possibly growing and sending back more traffic to the webstore than I originally sent to them, also being nice baits for Google to index.

The microsites could contain a standard feature set and customized skin. For example a forum for talking about dir en grey, but with a forum template showing the dir en grey members. Forums have the effect of getting people to come back to check if their posts have been answered. Another good one is quizzes, which tend to be viral since people like to post the results on their homepages or recommend the quizzes to their friends.

Of course this is nothing new, there are plenty of dir en grey fansites out there, but I would like to make the process of launching these microsites very organized. All the sites would actually share one codebase. There might be 100 different microsites for different bands or manga series for example, but only one forum software running, customized to display a different skin for different audiences, but only requiring one login to use any of those sites. Same for the quizzes or possibly other features. The skins might have been outsourced somewhere, quizzes could be created by the users.

This whole idea might be impossible in that a certain amount of manual labor is always required for the maintenance of those sites. Forums need moderators. Quizzes also need moderation, since if they can be freely created by users there can be inappropriate content. Still by being clever I imagine that I could organize the creation of such microsites to be more efficient than the normal work of creating a fansite (of course these would not really be fansites in the traditional sense, but feature-wise they would be the same).

Amazon and other big webstores might be missing a great opportunity when they are only pushing products at the visitors, where they could be pushing communities as well.

Saturday, January 13, 2007

eBay API experiences

Lately I have been trying to learn how to use the eBay API to list items and learning exponential representation for complex numbers in Algebra. Using the eBay API is the harder one out of those. Just a minute ago I finally succeeded at listing my very first item by using the XML API, it was a bit more complex than I thought! My mental model for how the API would work was that I would pass my eBay user id and password, along with the item details wrapped in some XML.

Nope, there are several different kinds of keys involved. All in all I currently have NINE different pieces of authentication! I have a DevID, an AppID and a CertID. Then there is the eBayAuthToken and the REST API key (which I admittedly only used once for testing, it is not needed for the XML API). But wait, that's only five? Yes, but you see eBay has two servers -- production and sandbox. The sandbox is for testing, which is useful since listing things on the production server costs money, so you definitely don't want to end up listing ten thousand items by accident. The sandbox and production servers have completely different authentication keys, except the DevID appears to be the same (making it nine different keys total).

The eBay developer site doesn't make this sandbox and production server difference clear. When talking about authentication keys, they casually mention that oh yeah, there is the sandbox server too. But what they don't say (on the intro pages at least) is that you need completely different keys for those. So imagine my frustration at attempting to access the sandbox with my shiny new production keys. With all those different keys I was getting really hopeless and uninformed, mostly reading reddit instead of focusing on the problem.

Somehow after a lot of digging I managed to figure it out. A DevID identifies a developer. A developer may have multiple applications, with each application identified with its own AppID. CertID is a magical entity the purpose of which I don't understand, but things seem to work when I bundle the same CertID that came with the AppID. The eBayAuthToken must be generated on their web page, and generating that requires providing correct DevID, an AppID and a CertID for the server which you are trying to use (sandbox or production). In other words you cannot get an eBayAuthToken for the sandbox server by using the production DevID, an AppID and a CertID + vice versa. The REST key is needed only for... you knew it, making REST calls.

After I finally had my keys I started to read the API reference. I tried to pretend calmness, but actually I was a bit shocked of seeing all the possible method calls and the arguments they take. Huge list. Maybe I'm not enough in the XML camp, but in my mind things work like this: you get a template string of a working XML call, then you change the things which are different from what you want and send that string at the server, which then does something cool. It's pretty difficult to try to come up with something that works by just looking at an API reference if there are 20 different arguments that could go wrong! Luckily, the developer center has very nice examples of using the API, so I was able to get things working by copying and pasting their examples.

Another thing which seemed like a showstopper at first was that they require usage of SSL to access their server. That is an excellent thing of course for security, but complicates things a bit when you are just trying to get a minimal example to work. I was planning on using PHP, but felt a bit intimidated at the thought of figuring out how to get SSL working on it. Just to get acquainted with the API, I decided to stick with Perl as they had some nice Perl examples in the developer center, complete with instructions on how to install SSL support for Perl.

So I had my keys, I had an XML request constructed from the example and I had ActivePerl installed on my box, with LWP and SSL support, aaand... it worked!

Update: After 30 mins of reading some example code I managed to figure out how to make the same request using PHP, HTTPS with cURL! One thing I was worried about was how image uploading would work, but turns out that you can just specify an image URL and eBay's server will go and fetch it -- no need to figure out how to actually upload the data, what a time saver! Just a bit more effort and I'll have this code integrated with my web store.