Skip to content

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenLayer Social Data

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.

Features

  • 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

Contract Functions

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

How to Deploy

  1. Open GenLayer Studio
  2. Create a new contract
  3. Paste the contents of contracts/social_data.py
  4. Click Deploy
  5. Call any function with the required inputs

Example Outputs

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

Repository Structure

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

Built With

License

MIT

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages