Skip to content

Commit

Permalink
add support for java, operating-systems and linux resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhupesh-V committed Mar 21, 2024
1 parent 4a34e31 commit 111a4e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ class FilterTypeForm(FlaskForm):
"Deep Learning": "deep-learning",
"Computer Science": "computer-science",
"Computer Graphics": "computer-graphics",
"Operating Systems": "operating-systems",
"Git": "git",
"Android": "android",
"Surprise Me!": "miscellaneous",
"DevOps": "devops",
"Rust": "rust",
"Java": "java",
"TypeScript": "typescript",
"Linux": "linux",
}


Expand Down Expand Up @@ -96,7 +99,7 @@ def category():

@app.get("/contributors")
def contributors():
contributors = resourcer.Resource.get_all_contributors()
contributors = resourcer.Resource.get_resources_contributors()
saadhan_contributors = resourcer.Resource.get_saadhan_contributors()

title = f"Saadhan is possible by more than {len(contributors)+len(saadhan_contributors)} community contributors 🤝 - r/developersIndia"
Expand Down
31 changes: 19 additions & 12 deletions resourcer/resourcer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ class Types(Enum):
CATEGORY_API_PATH = {
"python": "languages/python",
"javascript": "languages/javascript",
"c":"languages/c",
"cpp":"languages/c++",
"css":"languages/css",
"c": "languages/c",
"cpp": "languages/c++",
"css": "languages/css",
"ruby": "languages/ruby",
"sql":"languages/sql",
"git": "tools/git",
"go":"languages/go",
"sql": "languages/sql",
"rust": "languages/rust",
"java": "languages/java",
"typescript": "languages/typescript",
"go": "languages/go",
"android": "app-development/android",
"flutter": "app-development/flutter",
"miscellaneous": "miscellaneous",
Expand All @@ -40,9 +42,10 @@ class Types(Enum):
"dsa": "dsa",
"computer-graphics": "computer-graphics",
"computer-science": "computer-science",
"operating-systems": "operating-systems",
"devops": "devops",
"rust": "languages/rust",
"typescript": "languages/typescript",
"git": "tools/git",
"linux": "tools/linux",
}

requests_cache.install_cache("resource_cache", backend="memory", expire_after=180)
Expand Down Expand Up @@ -79,12 +82,16 @@ def get_resources_by_level(self, level: str):
if r.get("level") == level:
filtered_res.append(r)
return filtered_res

# @classmethod
def get_all_contributors():
res = requests.get("https://raw.githubusercontent.com/developersIndia/resources/master/.all-contributorsrc").json()
def get_resources_contributors():
res = requests.get(
"https://raw.githubusercontent.com/developersIndia/resources/master/.all-contributorsrc"
).json()
return res

def get_saadhan_contributors():
res = requests.get("https://raw.githubusercontent.com/developersIndia/saadhan/main/.all-contributorsrc").json()
res = requests.get(
"https://raw.githubusercontent.com/developersIndia/saadhan/main/.all-contributorsrc"
).json()
return res
9 changes: 3 additions & 6 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<meta name="twitter:site" content="@devsinindia">
<meta name="twitter:creator" content="@devsinindia">
<meta property="og:site_name" content="Saadhan - A resource hub by r/developersIndia">
<meta name="description" content="Saadhan is a comprehensive website created by the r/developersIndia community, which offers an extensive collection of resources to help you learn tech. Whether you are a beginner or an experienced professional, Saadhan has something for everyone. From articles and tutorials to videos and courses, you can find a wide range of tech-related content that will enhance your knowledge and skills.">
<meta property="og:description" content="Saadhan is a comprehensive website created by the r/developersIndia community, which offers an extensive collection of resources to help you learn tech. Whether you are a beginner or an experienced professional, Saadhan has something for everyone. From articles and tutorials to videos and courses, you can find a wide range of tech-related content that will enhance your knowledge and skills." />
<meta name="twitter:description" content="Saadhan is a comprehensive website created by the r/developersIndia community, which offers an extensive collection of resources to help you learn tech. Whether you are a beginner or an experienced professional, Saadhan has something for everyone. From articles and tutorials to videos and courses, you can find a wide range of tech-related content that will enhance your knowledge and skills.">
<meta name="description" content="Saadhan is a resource hub for the r/developersIndia community, which offers an extensive collection of tech resources. Whether you are a beginner or an experienced professional, Saadhan has something for everyone.">
<meta property="og:description" content="Saadhan is a resource hub for the r/developersIndia community, which offers an extensive collection of tech resources. Whether you are a beginner or an experienced professional, Saadhan has something for everyone." />
<meta name="twitter:description" content="Saadhan is a resource hub for the r/developersIndia community, which offers an extensive collection of tech resources. Whether you are a beginner or an experienced professional, Saadhan has something for everyone.">
<meta name="google-site-verification" content="jeqscIfDl_A3eUsQzbMRqd74G3WaI1GHVaV3DHkDD4A" />

<title>{{ title }}</title>
Expand All @@ -30,9 +30,6 @@
<body>
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<!-- <a class="navbar-item" href="https://bulma.io">
<img src="https://bulma.io/images/bulma-logo.png" width="112" height="28">
</a> -->

<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
Expand Down

0 comments on commit 111a4e4

Please sign in to comment.