|
From: <ku...@us...> - 2009-04-01 17:05:08
|
Revision: 337
http://mypyspace.svn.sourceforge.net/mypyspace/?rev=337&view=rev
Author: kurtjx
Date: 2009-04-01 17:05:04 +0000 (Wed, 01 Apr 2009)
Log Message:
-----------
fixed friend scraping stuff
Modified Paths:
--------------
musicGrabber/branches/webserv-branch/myspace2rdf.py
musicGrabber/branches/webserv-branch/myspaceuris.py
Modified: musicGrabber/branches/webserv-branch/myspace2rdf.py
===================================================================
--- musicGrabber/branches/webserv-branch/myspace2rdf.py 2009-03-23 11:15:35 UTC (rev 336)
+++ musicGrabber/branches/webserv-branch/myspace2rdf.py 2009-04-01 17:05:04 UTC (rev 337)
@@ -81,9 +81,15 @@
friendUIDs = scrapePageWhile(self.page, friendTag[0], friendTag[1])
friendNames = scrapePageWhile(self.page, friendNameTag[0], friendNameTag[1])
friendPics = scrapePageWhile(self.page, friendPicTag[0], friendPicTag[1])
-
+
+ #print friendUIDs
+
for i in range(len(friendUIDs)):
- friend = mopy.foaf.Person(dbtuneMyspace+'uid/' + str(friendUIDs[i]))
+ currentUID = friendUIDs[i]
+ if currentUID.isdigit():
+ friend = mopy.foaf.Person(dbtuneMyspace+'uid/' + str(friendUIDs[i]))
+ else:
+ friend = mopy.foaf.Person(dbtuneMyspace+str(friendUIDs[i]))
friend.name.set(friendNames[i])
try:
img = mopy.foaf.Image(friendPics[i])
@@ -91,8 +97,8 @@
except:
pass
- if artist==False:
- self.subject.knows.add(friend)
+ #if artist==False:
+ # self.subject.knows.add(friend)
# self.subject.knows.add(friend)
# since when did this happen??? mopy wont take foaf:knows as a prop of mo:MusicArtist
@@ -127,7 +133,6 @@
else:
#self.subject = mopy.mo.Agent('http://dbtune.org/myspace/uid/'+str(self.uid))
self.subject = mopy.foaf.Person(dbtuneMyspace+'uid/'+str(self.uid))
- self.subject = mopy.mo.MusicArtist(dbtuneMyspace+'uid/'+str(self.uid))
# add foaf:primaryTopic
ppd = mopy.foaf.PersonalProfileDocument("")
ppd.primaryTopic.set(self.subject)
Modified: musicGrabber/branches/webserv-branch/myspaceuris.py
===================================================================
--- musicGrabber/branches/webserv-branch/myspaceuris.py 2009-03-23 11:15:35 UTC (rev 336)
+++ musicGrabber/branches/webserv-branch/myspaceuris.py 2009-04-01 17:05:04 UTC (rev 337)
@@ -12,7 +12,8 @@
# useful tags
playerTag = """SWFObject("http://musicservices.myspace.com/Modules/MusicServices/Services/Embed.ashx/ptype=4""", ''';'''
# ### this tag will be terminated by a '.' ###
-friendTag = '''<td bgcolor="FFFFFF" align="center" valign="top" width="107" style="word-wrap:break-word">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <a href="http://profile.myspace.com/index.cfm?fuseaction=user.viewProfile&friendID=''', '''"'''
+#<td bgcolor="FFFFFF" align="center" valign="top" width="107" style="word-wrap:break-word">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
+friendTag = ''' <a href="http://www.myspace.com/''', '''"'''
# new tag updated 13/1/2009
#""" <a href="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=""", '''"'''
# ### tag will be terminated by a '"' ###
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|