+
+ def search(self, expr):
+ with urllib.request.urlopen(self.base + ("ajax/search.php?term=%s" % urllib.quote(expr))) as resp:
+ rc = json.load(resp)
+ return [manga(self, id, name, self.base + ("manga/%s/" % id)) for num, name, id, genres, author in rc]
+
+ def byid(self, id):
+ url = self.base + ("manga/%s/" % id)
+ page = soupify(htcache.fetch(url))
+ if page.find("div", id="title") is None:
+ # Assume we got the search page
+ raise KeyError(id)
+ name = page.find("div", id="series_info").find("div", attrs={"class": "cover"}).img["alt"]
+ return manga(self, id, name, url)
+
+ def __iter__(self):
+ raise NotImplementedError("mangafox iterator")