David Thomas Baker » Examples » MySpace Spider

MySpace Spider

In response to: http://www.dataportability.org/graphsync/

Here is a simple MySpace spider I created a while ago. It can collect the following:

  • User Details: (Name, Age, Gender, Location, Country, # of Profile Views, Last Login)
  • Comments
  • Friends List (Friend ID's and their thumbnail photos)

Works with Normal and Band profiles.

All the stuff is in class.myspace.php

Here's an example:

<?php
include("class.myspace.php");
$spider = new myspace();
$myspace_id = "dtbaker"; // or numerical id 49537019
// the below methods return simple arrays of data
$details = $spider -> get_details($myspace_id);
$friends = $spider -> get_friends($myspace_id);
$comments = $spider -> get_comments($myspace_id);
?>

Version 1.

Next on the list...

Didn't get time tonight, next few days I will look at writing a wrapper around the MySpace class to convert it into pretty hCard (update: done here) and XFN formats

Will also try and find the newer version I have around somewhere - it scrapes MySpace profile interests = APML

And yea: MySpace may ban you if they see you're scraping, heh

Files »

class.myspace.php

Links: Download View
Details: Simple class to interact with MySpace. Take note of the cookiejar location if you try run it on windoze.

test2.php

Links: Download View
Details: How to use the class (pretty simple)

spider.php

Links: Download View
Details: PHP Code used in the example




Links »

MySpace Demo

This is what I used the scraper for originally.
http://www.gclounge.com.au/myspace/flas...

MySpace to hCard

Quick demo showing MySpace to hCard
http://examples.dtbaker.com.au/code/mys...