- data = urllib.urlencode((
- ("message-id", messageid), \
- ("created", createddate), \
- ("contentmd5", md5sum) \
- ))
- db[url + "|" + item["link"]] = data
+ if item.has_key("guid") and item["guid"] != item["link"]:
+ data = urllib.urlencode(( \
+ ("message-id", messageid), \
+ ("created", createddate), \
+ ("contentmd5", md5sum) \
+ ))
+ db[url + "|" + item["guid"]] = data
+ try:
+ data = db[url + "|" + item["link"]]
+ data = cgi.parse_qs(data)
+ newdata = urllib.urlencode(( \
+ ("message-id", messageid), \
+ ("created", data["created"][0]), \
+ ("contentmd5", data["contentmd5"][0]) \
+ ))
+ db[url + "|" + item["link"]] = newdata
+ except:
+ db[url + "|" + item["link"]] = data
+ else:
+ data = urllib.urlencode(( \
+ ("message-id", messageid), \
+ ("created", createddate), \
+ ("contentmd5", md5sum) \
+ ))
+ db[url + "|" + item["link"]] = data
+
+ if headers:
+ data = []
+ for header in headers:
+ if header[0] in ["content-md5", "etag", "last-modified", "content-length"]:
+ data.append((header[0], header[1]))
+ if len(data) > 0:
+ data = urllib.urlencode(data)
+ feeddb[url] = data