Example #1
0
	def __get_entry_list_from_url(self, url):
		topic_soup = common.get_topic_soup(url, "ul")
		if topic_soup:
			return self.__get_entry_list_from_topic_soup(topic_soup)
		else:
			log.debug("Topic list is empty...")
			return None
Example #2
0
def search(q):
	#TODO: accept a full-fledged "hayvan ara" object and pass that in the URL
	#https://eksisozluk.com/basliklar/ara?searchForm.Keywords=yazar+nick%27lerinin+%C3%B6b%C3%BCr+d%C3%BCnya+versiyonlar%C4%B1&searchForm.Author=&searchForm.When.From=&searchForm.When.To=&searchForm.NiceOnly=false&searchForm.SortOrder=Date
	q = common.__transliterate(q)
	topic_list = []
	url = "https://eksisozluk.com/basliklar/ara?searchForm.Keywords=" + q + "&searchForm.Author=&searchForm.When.From=&searchForm.When.To=&searchForm.NiceOnly=false&searchForm.SortOrder=Date"

	topic_soup = common.get_topic_soup(url, "ul")

	for e in topic_soup.find_all('li'):
		topic_list.append(e.find("a")["href"])

	return topic_list
Example #3
0
def get_gundem():
	topic_list = []
	topic_soup = common.get_topic_soup("https://eksisozluk.com/basliklar/populer", "ul")

	for t in topic_soup.find_all('li'):
		topic = {}
		topic["url"] = t.find("a")["href"]
		smalls = t.find_all("small")
		[small.extract() for small in smalls]
		topic["title"] = t.find("a").get_text().strip()

		topic_list.append(topic)

	return topic_list
Example #4
0
def get_debe():
	topic_list = []
	topic_soup = common.get_topic_soup("https://eksisozluk.com/debe", "ol")

	for t in topic_soup.find_all('li'):
		entry = {}
		entry["creator"] = t.find('div', attrs={'class':'detail'}).get_text()
		entry["title"] = t.find('span', attrs={'class':'caption'}).get_text()
		href = t.find("a")["href"]
		match = re.search(r"23([0-9]+)$", href)
		entry["id"] = match.groups(1)[0]

		topic_list.append(entry)

	return topic_list