Top Related Projects
Pushshift API
Quick Overview
The reddit-archive/reddit repository is an archive of Reddit's source code from 2008 to 2017. It contains the historical codebase of the popular social news and discussion website, providing insights into its early development and evolution. This repository serves as a valuable resource for developers interested in studying the architecture and implementation of a large-scale web application.
Pros
- Offers a comprehensive look at Reddit's historical codebase
- Provides valuable insights into the development of a major social media platform
- Serves as an educational resource for developers studying large-scale web applications
- Allows for analysis of Reddit's evolution over time
Cons
- No longer actively maintained or updated
- May contain outdated coding practices and technologies
- Lacks documentation for setup and deployment
- Not suitable for use in modern production environments
Code Examples
- Example of defining a Reddit link:
class Link(Thing):
_defaults = dict(is_self=False,
clicked=False,
hidden=False,
score=1,
saved=False,
clicked=False,
hidden=False,
over_18=False,
stickied=False,
nsfw=False,
selftext='',
num_comments=0,
visited=False)
- Example of handling user login:
@validate(VRatelimit(rate_ip = True, prefix = 'login_'),
username = VUsername('user'),
password = VPassword('passwd'))
def POST_login(self, res, username, password):
user = Account._by_name(username)
if user and user.check_password(password):
self.login(user)
return self.redirect(request.referer or '/')
else:
return self.login_failure()
- Example of rendering a comment:
def render_comment(self, comment, context):
return Comment(body = comment.body,
author = comment.author.name,
created = comment.created_utc,
ups = comment.ups,
downs = comment.downs,
replies = [self.render_comment(reply, context)
for reply in comment.replies])
Getting Started
As this is an archived repository and not intended for active use, there are no specific getting started instructions. However, developers interested in exploring the codebase can follow these general steps:
- Clone the repository:
git clone https://github.com/reddit-archive/reddit.git
- Navigate to the desired branch or commit to explore different versions of the codebase.
- Review the README files and documentation within the repository for any available setup instructions or requirements.
- Note that running the application may require specific versions of Python and other dependencies, which may be outdated or no longer supported.
Competitor Comparisons
Pushshift API
Pros of pushshift/api
- More actively maintained with recent updates
- Focused API for efficient data retrieval and analysis
- Better documentation and community support
Cons of pushshift/api
- Limited to Reddit data, while reddit-archive/reddit is a full Reddit clone
- May have rate limits or usage restrictions
- Requires external hosting and setup
Code comparison
pushshift/api:
import requests
url = "https://api.pushshift.io/reddit/search/submission"
params = {"subreddit": "AskReddit", "size": 10}
response = requests.get(url, params=params)
data = response.json()
reddit-archive/reddit:
from r2.models import Link, Comment
from r2.lib.db import queries
top_links = queries.get_links("top", "all")
comments = Comment._query(Comment.c.link_id == Link._id)
The pushshift/api code demonstrates a simple API request to retrieve Reddit submissions, while the reddit-archive/reddit code shows direct database queries for fetching links and comments. pushshift/api offers a more straightforward approach for data retrieval, but reddit-archive/reddit provides deeper access to the underlying Reddit data structure and functionality.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
This repository is archived.
This repository is archived and will not receive any updates or accept issues or pull requests.
To report bugs in reddit.com please make a post in /r/bugs.
If you have found a bug that can in some way compromise the security of the site or its users, please exercise responsible disclosure and e-mail security@reddit.com.
API
For notices about reddit API changes and discussion of reddit API client development, subscribe to the /r/redditdev and /r/changelog subreddits.
To learn more about reddit's API, check out our automated API documentation and the API wiki page. Please use a unique User-Agent string and take care to abide by our API rules.
Quickstart
To set up your own instance of reddit see the install guide.
Top Related Projects
Pushshift API
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot