Created
November 20, 2014 04:06
-
-
Save kyu999/744d9567eaebdc68cf1c to your computer and use it in GitHub Desktop.
backup manga mining
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
def constructContents(i: Int): List[Content] | |
= (1 to amount).map{ i => | |
val id = cache.get("week_pop_id_" + i) | |
val title = cache.get("week_pop_title_" + i) | |
val views = cache.get("week_pop_views_" + i) | |
val category = cache.get("week_pop_category_" + i) | |
val date = cache.get("week_pop_date_" + i) | |
val storages = content.storages.map( link => cache.rpush("week_pop_storages_" + i, link) | |
} | |
def saveContentsToRedis(contents: List[Content]) = | |
= contents.zipWithIndex.foreach{ each => | |
val content = each._1 | |
val i = each._2 | |
cache.set("week_pop_id_" + i, content.id) | |
cache.set("week_pop_title_" + i, content.title) | |
cache.set("week_pop_views_" + i, content.views) | |
cache.set("week_pop_category_" + i, content.category) | |
cache.set("week_pop_date_" + i, content.date) | |
content.storages.foreach( link => cache.rpush("week_pop_storages_" + i, link) | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/*
def toDbContent(content: Content): DBObject =
DBObject(
"id" -> content.id, "title" -> content.title, "category" -> content.category,
"date" -> content.date, "img" -> content.img, "views" -> content.views, "storages" -> content.storages
)
*/