A reusable social media data library for GenLayer Intelligent Contracts to fetch and analyze public data from GitHub, Reddit, and Hacker News — no API keys required.
- GitHub developer profile summaries
- GitHub repository stats (stars, forks, issues, language)
- On-chain GitHub developer reputation scoring
- Active developer detection
- Reddit top posts by subreddit
- Reddit community sentiment analysis
- Reddit trending topic extraction
- Hacker News top stories
- Hacker News story details
| Function | Input | Output |
|---|---|---|
get_github_profile(username) |
GitHub username | Profile summary |
get_github_repo_stats(username, repo) |
Owner + repo name | Stars, forks, issues |
get_github_reputation_score(username) |
GitHub username | Score 0-100 + reason |
is_active_github_developer(username) |
GitHub username | Yes/No + reason |
get_reddit_top_posts(subreddit) |
Subreddit name | Top 5 posts + upvotes |
get_reddit_sentiment(subreddit) |
Subreddit name | Positive/Negative/Neutral |
get_reddit_trending_topics(subreddit) |
Subreddit name | Top 3 topics |
get_hackernews_top_stories() |
None | Top 5 story IDs |
get_hackernews_story(story_id) |
Story ID | Title, score, comments |
- Open GenLayer Studio
- Create a new contract
- Paste the contents of
contracts/social_data.py - Click Deploy
- Call any function with the required inputs
get_github_profile("torvalds")
Name: Linus Torvalds
Bio: Linux and Git
Public Repos: 7
Followers: 220,000
Following: 0
get_reddit_sentiment("cryptocurrency")
Positive — most top posts discuss price gains and optimism about upcoming ETF approvals.
get_reddit_top_posts("technology")
1. AI is changing the way we code — 42,300 upvotes
2. New open-source model beats GPT-4 on benchmarks — 38,100 upvotes
3. EU passes landmark data privacy law — 29,800 upvotes
4. Tesla recalls 50,000 vehicles over software bug — 21,400 upvotes
5. Google announces quantum computing breakthrough — 18,900 upvotes
genlayer-social-data/
├── contracts/
│ └── social_data.py # Main Intelligent Contract
├── examples/
│ ├── github_reputation.py # GitHub examples
│ ├── reddit_trends.py # Reddit examples
│ └── hackernews_tracker.py # Hacker News examples
├── utils/
│ └── popular_accounts.py # Reference accounts list
├── LICENSE
└── README.md
- GenLayer — AI-powered blockchain
- GitHub API — Free public GitHub data
- Reddit API — Free public Reddit data
- Hacker News API — Free public HN data
MIT