Last active
March 21, 2022 18:10
-
-
Save andfanilo/bce47cec3b53eb5a23a5032b8c3295bc to your computer and use it in GitHub Desktop.
Query to sort issues in Github project per number of +1 reactions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
from ghapi.all import GhApi | |
@st.experimental_singleton | |
def load_ghapi(): | |
return GhApi() | |
@st.experimental_memo | |
def search_query(q: str): | |
return load_ghapi().search.issues_and_pull_requests(q, per_page=10) | |
def search_stargazers(): | |
return paged(load_ghapi().activity.list_stargazers_for_repo, "streamlit", "streamlit", headers={"Accept": "application/vnd.github.v3.star+json"}) | |
st.title("Get the open issues with most reactions") | |
repo = st.text_input("Enter repo (as username/repository)", "streamlit/streamlit") | |
if repo == "": | |
st.stop() | |
query = f"repo:{repo} is:open reactions:>10 sort:reactions-+1-desc" | |
res = search_query(query) | |
for item in res.get("items"): | |
with st.expander(item.title): | |
st.markdown(item.body) |
Author
andfanilo
commented
Mar 21, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment