94. MySpace parser

Here's a MySpace parser. Usage is straightforward; the constructor takes a MySpace URL or numerical ID, and profile, friend and comment details are exposed as attributes:

from MySpace import *

n = MySpace('soundofnorthwood')

total_friends = n.friend_count

last_comment = n.comments[0]

MySpace.py requires version 3 of Beautiful Soup to grok MySpace's miserable HTML. You could use it to make an RSS feed of your comments, or for a mobile-friendly proxy to MySpace content. I'm using it for some examples in a session I've giving at Media in Transition 2006 on Natural Language and Social Software.

Update: now at version 0.2. Thanks, Tim Hatch, for your entity-handling contribution.

© Tom Dyson 2007

Home | About | Contact | Search | Archives