def getVineUsersFromDatabase(self): print "getting users from database" userDocuments = dc.findAllDataFromCollection("VineDatabase", "SampledASONAMUsers") for document in userDocuments: self.userDocumentList.append(document) print "getting users from database is finished." self.userDocumentList = self.userDocumentList[0:10000]
def getVineMediasFromDatabase(self): print "getting media sessions from database" mediaDocuments = dc.findAllDataFromCollection("VineDatabase", "SampledASONAMPosts") for document in mediaDocuments: self.mediaSessionList.append(document) print "getting media sessions from database is finished." self.mediaSessionList = self.mediaSessionList[0:983]
def getVineUsersFromDatabase(self): print "getting userids from database" userDocuments = dc.findAllDataFromCollection("VineDatabase", "ASONAMCollectedUser") for document in userDocuments: self.userIDList.append(document['userId']) self.userIDList = self.userIDList[0:1000] print "getting userids from database is done." print "total users collected: "+str(len(self.userIDList)) print "##########################################"
def getVineCommentsFromDatabase(self): print "getting comments from database" commentDocuments = dc.findAllDataFromCollection("VineDatabase", "SampledASONAMComments") for document in commentDocuments: postId = str(document["postId"]) userId = str(document["userId"]) commentText = str(document["commentText"].encode("utf8")) if str(document["type"]) == "mention": commentType = "mention" elif str(document["type"]) == "tag": commentType = "tag" else: commentType = "other" comment = VineComment(commentText,userId,postId,commentType) if str(postId) in self.mediaCommentDictionary: self.mediaCommentDictionary[postId].append(comment) else: self.mediaCommentDictionary[postId] = [] self.mediaCommentDictionary[postId].append(comment) print "getting comments from database is finished."
def getVideoUrls(self): print "getting media sessions urls from database" mediaDocuments = dc.findAllDataFromCollection("VineDatabase", "SampledASONAMPosts") for document in mediaDocuments: self.mediaURLMap[str(document["postId"])] = str(document["videoUrl"]) print "getting media sessions urls from database is finished."