Archive for the ‘Uncategorized’ Category.

How to get the high score on Foursquare

My score after two days

I know that GPS-based social networking startup Foursquare is supposed to “helps you keep up with your friends, expose you to new things in and challenge you to explore cities in different ways”. But I had some free time and, with a little Christmas shopping to do, decided to see how high I could get my score.

Why would you want to do that? For fun, mainly. But also for the promotional opportunities of a #1 spot on the leaderboard (at right).

My score after two days

The way you succeed is to game two of Foursquare’s weaknesses: you can check in every ten minutes, and you get a “travel bonus” score which increases, and is awarded, after each consecutive check-in on the same day.

Note that it doesn’t matter so much if you’re visiting new places and getting the +5 new location bonus. As your travel bonus combo increases, the new location bonus becomes a mere fraction of the total points received.

You’ll need a day or two where you can travel away from home for a few hours, or a neighbourhood with a rich roster of places to visit. It helps to set a timer to remind you to check in every ten minutes. It also helps to start the day with checkins away from home, so that when you’re home in the evening you can continue with venues near your house (since you only get points for a venue once a day).

When the timer goes off, check in at a nearby location and go on with your life for ten minutes. Rinse and repeat for a few hours. After one hour, your travel bonus will be 6 points. After three hours, it will be 18. Pretty soon you can be increasing your score by over 150 points per hour. And you’ll rocket up the rankings in your city. Just change your name in Foursquare’s setting so that your first name is the domain you want plugged, and your surname is blank.

This may not work for all locations. As I’ve been active in Sydney, different rules may be in place. Foursquare claims not to award points during work hours, but the 1200 points above were mainly accumulated on a Monday and Tuesday morning while Christmas shopping. And I fully expect these loopholes to be closed, as they allow for some pretty lame activities to happen (like the ones detailed here).

This is two days’ work. A rough calculation shows that the maximum points for 24/7 Foursquaring is at least 70,000 per week. I don’t think I’ll be investigating that one.

UNSW Library Lawn in Photosynth

Today I went out onto the Library Lawn at work and took 75 images, which I then dropped into Microsoft’s rather excellent Photosynth tool, building the panorama you’ll see embedded below (or here) if you’ve got Silverlight plugin installed (unfortunately this excludes OSX):

I really was quite surprised at how quick and easy it was to build this panorama. True, walking around taking lots of photos is a bit of a drag, but the whole process took less than half an hour.

HOWTO: Track user activity on your PHPBB forum

Introduction

I run a music forum called Small Night In using PHPBB forum software. Like any website owner, I’m interested in the user activity on my site. That’s why I run Google Analytics, which covers visitor numbers, referring sites, and a wealth of other useful data. Additionally, PHPBB reports the number of users, topics and posts in total and on average.

However, what PHPBB doesn’t report is potentially more useful: long-term trends in growth or decline of active users and new posts. Tracking visits in Google Analytics isn’t sufficient, because some visitors are casual and don’t return – active, registered users are the most valuable to a forum. Tracking the average daily number of posts is no good either, because it gives an average and not an ongoing series of activity snapshots.

To address both these issues, I’ve written a useful script which will allow someone with a minimal amount of PHP/MySQL knowledge to track the long-term number of active users and daily posts on their website.

The script, in brief:

  • Get the time and date 24 hours ago
  • Count how many users last visited later than that time
  • Count how many posts were created later than that time
  • Output the results

The script output is (according to the user’s needs) either a simple PHP echo() of the number to a webpage, or written to a .CSV file for easy long-term tracking and charting.

The script

The first part of the code is just database settings, which you should personalise as needed:

// Change these to your MySQL details
$host = "localhost"; // you probably won't need to change this setting
$user = "your_php_username";
$pass = "your_php_password";
$database = "your_phpbb_database_name";

The next section grabs the current timestamp and subtracts one day’s worth of seconds, as well as yesterday’s date in YYYY-MM-DD format:


$time24hoursago = time() - 86400; // Get the timestamp for a day ago by subtracting 24*60*60 seconds
$date = date('Y-m-d', $time24hoursago);

In the next section, we get the number of entries (users) in `phpbb_users` where the timestamp in `user_lastvisit` is more recent than the $time24hoursago timestamp:


// Database query, recent users
$conn = mysql_connect( $host, $user, $pass ) or die ("Could not connect to MySQL");
$rs = @mysql_select_db($database, $conn) or die("Could not connect to database");
$sql="SELECT COUNT(user_id) FROM `phpbb_users` WHERE `user_lastvisit` > '$time24hoursago'";
$rs = mysql_query( $sql,$conn );
$activeusers = mysql_fetch_array($rs);

Then we do the same thing for recent posts:


// Database query, recent posts
$sql="SELECT COUNT(`post_id`) FROM `phpbb_posts` WHERE `post_time` > '$time24hoursago'";
$rs = mysql_query( $sql,$conn );
$posts = mysql_fetch_array($rs);

Now the arrays $activeusers and $posts contain the number of users and posts. If you just want to see the results, a simple echo command will do the trick:


echo $date . ',' . $activeusers["0"] . ',' . $posts["0"];

Of course, you might be like me, and want to automate the entire process using cron. This next bit of script will write the date and number to a .CSV file called “forum_activity.csv” in the format YYYY_MM_DD,users,posts. For the following process, I’ve modified the file append tutorial on Tizag.com:


$myFile = "public_html/scripts/forum_activity.csv"; // this is the file we'll put the results in
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = $date . ',' . $activeusers["0"] . ',' . $posts["0"] . "\n";
fwrite($fh, $stringData);
fclose($fh);

Mind the file path $myFile. If you’re running this script through a web browser, you’ll want to make the reference local – that is, have the file path as just “forum_activity.csv” and place the file in the same folder as the script. But if you run this script through cron – for instance daily at midnight, as I do – you’ll want to put the full path to the .csv file or cron won’t be able to find it. Always test before leaving this running for a week and finding it doesn’t work!

Busted 986 Boxster

Came across this smash this afternoon – bad day for the driver of the other car (a 4WD), if he was at fault:

Porsche 986 Boxster smash

Porsche 986 Boxster smash

Beware of Byron Bay Accom

Planning a trip to Byron Bay? Be careful who you use to make your booking.

Byron Bay Accom calls itself “Byron’s Largest and Official Accommodation Service”. How this is possible is beyond me – its website or its staff seems unable to properly maintain the list of available accommodation, and will take reservations (though not money, thank God) for properties that are already booked out. What’s more, the website will tell you the property is still available.

I’m steamed up because I booked six nights in an apartment on Cape Byron, only to be told that it’s ‘not available’ the day after receiving a booking confirmation. What’s more, the site assures visitors that “Rates and availability are 100% up to date and your booking will be instantly confirmed.” Bullshit. I didn’t get a ‘booking confirmation’, I got a ‘casual confirmation of interest in an apartment that may or may not be available’.

Why is their website inaccurate? I can hazard a guess. A large number of properties on their website are smaller apartment/bed-and-breakfast accommodation, run by private operators. Although Byron Bay Accom can take reservations on behalf of these operators, BBA apparently can’t keep track of bookings that the operators make themselves. Being able to manage their own guest lists is good business for the operators, but bad for BBA and customers, because there’s no guarantee that inventory is actually available. It’s a bad look for Byron Bay that its official accommodation service is such a dismal middleman.

If you’re planning a trip to Byron Bay, here’s what you can do:

  • Research online, book over the phone. Dealing with a human being offers better reliability, as they’re in a position to check whether a property is available.
  • Better still, see if you can find the operator’s details and contact them personally. For instance, google the property name and address to see if the operator has a website.
  • Remember nothing is final until you’ve paid. BBA has proven that, unless money changes hands, you’re out of luck if your ‘booking’ turns out to be wishful thinking.
  • Book your accommodation through Stayz.com.au, who gave accurate information first time and had me in contact with the owner in hours.

Oh, and don’t pay any attention to locals who cry about tourism while enjoying all of its benefits.

Why do they call it ‘cloud’ computing?

Because everybody knows the internet is a cloud.

Because everybody knows the internet is a cloud.