Skip to content

Commit 7cf2073

Browse files
Merge pull request #37 from Solivagant14/issue-35
Solved Issue #35 and Changed the Sorting of answers by Upvotes
2 parents e923b47 + da12dfc commit 7cf2073

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/arguments/utility.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import requests
2+
import html
23
from termcolor import colored
34
from rich.console import Console
45
from rich.markdown import Markdown
@@ -17,6 +18,7 @@ class MarkdownRenderer(object):
1718
def __init__(self, markdown_text, console_print=True):
1819
assert isinstance(markdown_text, str), "Expected a string"
1920

21+
markdown_text = html.unescape(markdown_text)
2022
self.markdown_text = markdown_text
2123
self.do_console_print = bool(console_print)
2224

@@ -94,7 +96,7 @@ def get_ans(self, questions_list):
9496
for questions in range(1):
9597
try:
9698
resp = requests.get(
97-
f"{self.search_content_url}/2.2/questions/{questions_list[questions]}/answers?order=desc&sort=activity&site=stackoverflow&filter=!--1nZwsgqvRX"
99+
f"{self.search_content_url}/2.2/questions/{questions_list[questions]}/answers?order=desc&sort=votes&site=stackoverflow&filter=!--1nZwsgqvRX"
98100
)
99101
except:
100102
SearchError("Search Failed", "Try connecting to the internet")

0 commit comments

Comments
 (0)