diff --git a/docs/data.md b/docs/data.md index 468934e..c8642bf 100644 --- a/docs/data.md +++ b/docs/data.md @@ -60,3 +60,39 @@ curl -s https://tanbirramim.github.io/open-source-radar/data/issues.json \ ``` A snapshot of this data is also published as a dataset on Hugging Face: [TanbirRamim/open-source-radar](https://huggingface.co/datasets/TanbirRamim/open-source-radar), with an `issues` table and a `repositories` table. + +## Feeds + +Every language and topic has an RSS feed of beginner issues, so you can follow new ones in any feed reader. + +- Feed index: https://tanbirramim.github.io/open-source-radar/feeds/ +- One language: `https://tanbirramim.github.io/open-source-radar/feeds/.xml`, for example [python.xml](https://tanbirramim.github.io/open-source-radar/feeds/python.xml). The slugs are in `language_slugs` in `issues.json` (`cpp`, `csharp`, `go`, ...). +- One topic: `https://tanbirramim.github.io/open-source-radar/feeds/topics/.xml`, for example [ai-ml.xml](https://tanbirramim.github.io/open-source-radar/feeds/topics/ai-ml.xml). The slugs are in `topic_feed_slugs`. + +## Python example + +Standard library only. It downloads `issues.json`, looks up each issue's repository language and prints the five newest beginner issues for one language. + +```python +import json +import urllib.request + +DATA_URL = "https://tanbirramim.github.io/open-source-radar/data/issues.json" +LANGUAGE = "Python" + +with urllib.request.urlopen(DATA_URL, timeout=30) as response: + data = json.load(response) + +repos = data["repositories"] +matches = [ + issue + for issue in data["issues"] + if issue["level"] == "beginner" and repos.get(issue["repo"], {}).get("language") == LANGUAGE +] +matches.sort(key=lambda issue: issue["created"], reverse=True) + +print(f"{len(matches)} beginner {LANGUAGE} issues") +for issue in matches[:5]: + print(f"{issue['repo']}#{issue['number']}: {issue['title']}") + print(f" {issue['url']}") +```