I've added a new project to Soycode - the Python Web Arcade. You can see it in action at the proles.net flash game arcade.
At the moment it's a very simple script which creates an even simpler site, but when the goal is to play web games the site design (and ads and etc.) should definitely take the back seat. All you need to host it is support for Python CGI - no SQL db or other nonsense required. The current functionality allows you to then use it as a custom auto post script with Mochi Media (a SF-based company offering over 15,000 flash games), meaning that once it's set up you can basically just explore and pick and choose from Mochi's game catalog, adding games to your site with a single click.
When the post request is made to the script, it does two main things. It first fetches the complete game feed and information from Mochi using Python Mochi. It then creates a page to display the game (example) and updates the index of your site with a thumbnail linking to that game page.
The site-making portion of the script is also capable of being run independently of adding a new game, in which case it checks your entire game library with the current Mochi repository and updates any games that are out of date. You can again run it from your browser using Python CGI, or you can execute the update directly from the command line (or cron it for convenience).
And that's it really - there's a healthy number of todos and known issues, but I hope this script is useful to others regardless. The main todo is making an admin interface of some sort that facilitates customization (at the moment you have to specify publish ID and other site aspects by editing the code - it's easy, but I suppose will still intimidate some). The main known issue is that not absolutely every Mochi game works - certain older games seem to not have the same sort of game_tag or otherwise fail with the Python Mochi package I am using.
But despite those caveats, I at least found this a fun and useful experience and hope others can as well. If nothing else, it's the only "flash web game arcade" script I'm aware of that is *not* written in PHP - which in my book is an excellent thing. In fact, the preponderance of PHP was the main reason I chose to write this at all, as I wanted something I could easily understand and customize. Python CGI turned out to be a very straightforward and pleasant experience, and I would suggest it for anyone looking to make a quick and simple "web app."
No comments:
Post a Comment