Skip to navigation

malevolent design weblog

This blog is now defunct, but you can find more stuff over at my personal site

Posting Scores To Twitter From Flash Games

It’s great to give games things like high score tables and social networking integration, but there isn’t always time for server-side coding or working out how to hook into a third-party service. Here’s a really simple feature that can help players to publicly share their scores and thereby promote the game.

Twitter allows the contents of a tweet to be prepared by putting it on the end of

http://twitter.com/home?status=

The user has to be logged in and click the ‘Tweet’ button to post it, but there’s no authentication/API faff, just a simple URL.

So when someone plays a game and is presented with their score, you can show a ‘Post to Twitter’/‘Challenge Friends On Twitter’ button that when clicked does something like

// ActionScript 2
getURL('http://twitter.com/home?status='+
	escape('played '+gameTitle+' '+shortUrl+' and scored '+score+' #'+hashTag),
	'_blank');

// ActionScript 3
navigateToURL(new URLRequest('http://twitter.com/home?status='+
	encodeURIComponent('played '+gameTitle+' '+shortUrl+' and scored '+score+' #'+hashTag)),
	'_blank');

to generate a tweet along the lines of

played Captcha Invaders http://bit.ly/Mh24J and scored 12345 #captchainvaders

Obviously it’s not a seamless experience, and the score can be freely edited, but it’s incredibly easy to implement and may encourage players to spread the word.


Comments


Comments are now closed for this entry.