#this script captures the current posted links from a del.icio.us webpage
import urllib
import os
#creates list of delicious webpages to pull links from
webpageList = ["http://del.icio.us/popular/mapping","http://del.icio.us/popular/design", "http://del.icio.us/popular/webdesign", "http://del.icio.us/popular/web2.0",
"http://del.icio.us/popular/technology", "http://del.icio.us/popular/geography"]
outfile = open('../includes/linkgrabber.php', 'wt') #opens/creates the linkgrabber.php file
#function that opens the file, copies it as a list, and strips the links from it
def grabLinks(webpage):
sock = urllib.urlopen(webpage)
htmlSource = sock.readlines()
sock.close()
i=0
lines = []
links = []
for i in htmlSource:
if 'nofollow' in i:
j = i.find('')
lines.append(i[j:k])
outfile.write('')
h = 0
for i in lines:
l = i.find('http:')
m = i.find('" ')
n = i.find('">')
o = i.find('
')
linkText = i[n+2:o-1]
if h < 7 and linkText != 'save this':
links = '