Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response hard to preprocess outside Slack #5

Open
arifpz opened this issue Sep 20, 2024 · 4 comments
Open

Response hard to preprocess outside Slack #5

arifpz opened this issue Sep 20, 2024 · 4 comments

Comments

@arifpz
Copy link
Owner

arifpz commented Sep 20, 2024

The response is not json format, it's tricky to process it if other system need make a API call. Sample response:

Stack Overflow Top Questions for "postgres performance"

|15| :white_check_mark: <http://stackoverflow.com/questions/45629767|Postgres performance for a table with more than Billion rows> (3 answers)
|12| :white_check_mark: <http://stackoverflow.com/questions/11940515|Postgres performance issues> (4 answers)
|12| :white_check_mark: <http://stackoverflow.com/questions/52674380|Improving Postgres performance on graph-like queries of multi-level self-joins (comparison to Neo4j)> (2 answers)
|10| :white_check_mark: <http://stackoverflow.com/questions/41994392|Postgres - Performance of large jsonb column> (1 answers)
|10| :white_check_mark: <http://stackoverflow.com/questions/43718390|Postgres performance not increasing with increase in number of core> (2 answers)
@AfifOsama
Copy link

AfifOsama commented Sep 21, 2024

does this your expected result?

Stack Overflow Top Questions for "flutter"

794  ✅ http://stackoverflow.com/questions/48893935 - How can I remove the debug banner in Flutter? (16 answers)
658  ✅ http://stackoverflow.com/questions/50081213 - How do I use hexadecimal color strings in Flutter? (33 answers)
616  ✅ http://stackoverflow.com/questions/68236007 - I am getting error &quot;cmdline-tools component is missing&quot; after installing Flutter and Android Studio... I added the Android SDK. How can I solve them? (25 answers)
594  ✅ http://stackoverflow.com/questions/49991444 - Create a rounded button / button with border-radius in Flutter (41 answers)
590  ✅ http://stackoverflow.com/questions/43928702 - How to change the application launcher icon on Flutter? (18 answers)

@erric-syd
Copy link

erric-syd commented Sep 21, 2024

Convert the output from list of string into json format, is this ok?

SCR-20240921-nqwd

Solving:
- Import jsonify to flask to easily create json responses.
- Instead of a list of string responses, we create a dict that will be converted to JSON.
- Create a list of dicts for the questions, each contains title, link, and score.
- If no questions are found, we return a JSON object with a msg and empty questions list.
- Return list of successful responses

@aliepba
Copy link

aliepba commented Sep 21, 2024

image
should like this ?

@nabeel1209
Copy link

image
is this the response you needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants