def search_images(self, tag_string, pages): results = [] for i in xrange(pages): search = requests.get(("http://danbooru.donmai.us/posts.json?limit=20&page=" + str(i) + "&tags=" + tag_string), auth=HTTPBasicAuth(self.user, self.key)) table = search.json() for posts in table: img = queries.post(posts, None, self) results.append(img) return results
def create_image(self, image_id): image_table = requests.get(("http://danbooru.donmai.us/posts/" + image_id + ".json"), auth=HTTPBasicAuth(self.user, self.key)) image = queries.post(image_table, image_id, self) return image