You may see that I am getting some cool flash games on the Games page. This is one of my experiment on fetching games from MochiAds. I am now running an facebook application called "Mini Games Collection" with similar method.
What is MochiAds Games? MochiAds is an advertising network for flash games. Being a developer, you can make your flash games and put an ads on the loading scene. Then you will get your revenue every time the player click the ads.
Being a publisher, like who make the game portal with MochiAds games. They will give you 10% revenue share every time player click the ads. Yes, you host other developers' flash games and you will get revenue. You just need to sign up at MochiAds and download the game it provides and host it on your webpage, blog, wordpress, facebook etc.
Read the games feed
To make a game portal, you need to become a publisher. After you sign up, you will be able to access to the MochiAds Feed. You can choose both JSON or XML. I will use JSON in this tutorial.
The feed is updated every day. That means you will keep having new content for you game portal. And there are already almost 3000 games available now. You are able to kick off your portal without worrying no games on it.
Ok, let's get start on reading the games feed.
I am using python to download the feed and parse the json.
!/usr/bin/python
importurllib,json,sys# Downlaod the feed
m = urllib.urlopen("http://www.mochiads.com/feeds/games/{your key}/all/all?format=json")
f = m.read()# Use Python-json to parse the feed
obj = json.read(f)
Now we are accessing the feed with almost 3000 flash games. Next step we will use python to download all swf of the games. You need to download the games because you need to host the game on your domain to get revenue share.
For developers or unix/linux users, terminal is always their friend. I recently face a problem that I need to change my focus between vim in terminal and web browser or Adobe Flash rapidly. I need vim to code the php/html and use firefox to preview it. Or I need vim to code the actionscript and compile it in Adobe Flash.
There is a way to toggle full screen terminal and hide it with only a hot key in Leopard or Tiger. It is Visor from Blacktree
It is a terminal plugin that make a terminal window look like a console window in Quake or Counter-Strike. When the hot key (default CTRL+F1) is pressed, a terminal will appear on the top of the screen.
I changed the transition time to 0.1s. And then changed the terminal height from 24 to 62. 62 rows fits in a 1440x900 macbook pro for a fullscreen visor terminal.
Now I can toggle my vim very fast by just typing CTRL+` (the default visor key is CTRL+F1). It is really very nice and handy.
And here is a screenshot of my working project on vim in visor terminal with full screen:
Hello. It has been a long time since last post. In this period, my makbook pro (Yes, "Mak"book) got something wrong. The screen will keep black after boot up and the grey screen did not show. I checked several time myself that it does started up and everything is working without the display. The Mac OSX still boot up, or the bootcamp still boot up with the windows' welcome sound.
The problem is this black screen problem did not show up every time. Sometimes when I could boot the mbp with screen on after trying for many times. Sometimes the screen will suddenly work if I press some boot up key combination, such as 'c', 'shift', 'reset p ram', 'eject' button. But most of the time the screen did no work and kept black.
This problem has been annoying me for more than a month. I tried not to put the mbp sleep or not shut it down. But when times passed, the problem were getting more serious. At last, I try two whole days and failed to boot the mbp with screen. Then I brought it to Apple Repair Center in Hong Kong.
Luckily my mbp is still with 1 year so I got my mbp fixed without paying any money.
I got my fixed mbp within one week I sent to the center. And the reason seems to be Logic Board failed. I got a new Logic Board inside my mbp now. And now I can keep on writing great things here.
The player played this basketball game beyond godlike. The scroll counter overflow and reset to 000 after count over 999. It's really crazy. The hands move like a machine robot.
In previous post, I talked about a chatterbot called "Anna" who will answer your question about IKEA and bring you to the pages you want to visit.
Today let's try to build our online assistance to help visiting the website. Here is my requirement of the online assistance. Basically, the chatterbot can show me the pages I want to visit. For example, if I type "Please show me the company history". Then the page will got to "Company_history.htm".
There are several chatterbot program that can be download and used on the web. Most of them need sever-side script such as PHP / ASP and a database. Here I used a Javascript chatterbot that I talked in previous post about "Build your own chatterbot". However it need some code modification to make it work as a navigator and online assistance of your website.
First, you need to download the script from Alkali's Website or here. Then include the script within HEAD section.
Afterwards we need to an onLoad statement in the BODY tag: