historical code from reddit.com

Overview

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 [email protected].


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.

Comments
  • Start re-displaying upvote/downvote numbers

    Start re-displaying upvote/downvote numbers

    Removing the counter was a terrible decision and I think most of us can agree on that!

    So, lets start re-displaying the counter and forget it ever happened :smile:

    opened by BukhariH 104
  • Fix

    Fix "hot" algorithm to treat negative score sanely

    The hot algorithm applies the "sign" of a post's score weirdly. This has been noticed before.

    The time-based value is a large value that grows over time, so applying the sign to that yields weird results for posts with negative score. Not only do posts with a negative score rank lower than all positive posts, but older negative posts actually rank higher than newer negative posts, all else being equal.

    Here's what I mean:

    _hot(1, 0, 1262304000) #=> 2850.0
    _hot(0, 1, 1262304000) #=> -2851.0
    _hot(0, 1, 1353107345) #=> -4869.0
    

    With this patch, it returns much more expected values:

    _hot(1, 0, 1262304000) #=> 2850.0
    _hot(0, 1, 1262304000) #=> 2850.0
    _hot(0, 1, 1353107345) #=> 4868.0
    
    opened by iangreenleaf 34
  • check 'limit my search to X' by default

    check 'limit my search to X' by default

    I probably check this box 90% of the time I do a search on a subreddit page. The last time I checked (heh), RES checked this box by default as well. Thoughts?

    opened by samertm 21
  • don't mark links visited on right click or on drag

    don't mark links visited on right click or on drag

    a common use case, for example, is right click / open in incognito. it's not good to add links to history when that's the user's intent, so this function shouldn't be run on right clicks.

    confession: this is a blind-ish PR I whipped up real fast without testing because my VM is dead. If someone with a running VM could test this, I'd appreciate it. Otherwise, I'll try to get it running again soon.

    I do think it should work though. Pretty simple change.

    opened by honestbleeps 18
  • Add 'allowfullscreen' attribute to expando media embeds so html5 youtube videos can go full screen.

    Add 'allowfullscreen' attribute to expando media embeds so html5 youtube videos can go full screen.

    TL;DR: Minor frontend bug / annoyance with HTML5 Youtube links in expando. HTML5 Youtube embeds are missing the fullscreen button. I added an attribute "allowfullscreen" to the iframe, and now it works! Yay!

    To reproduce:

    1. Go to http://www.youtube.com/html5, enable html5 videos
    2. Click expando on any youtube video on reddit
    3. Note the missing fullscreen button in the embedded player

    In order to allow embedded html5 youtube videos to have a fullscreen option in expando, the containing iframe needs to have attribute "allowfullscreen".

    See W3C Fullscreen Specifications, Section 7: Security and Privacy Considerations:

    To prevent embedded content from going fullscreen only embedded content specifically allowed via the allowfullscreen attribute of the HTML iframe element will be able to go fullscreen. This prevents untrusted content from going fullscreen.

    Proof that this fix works: http://imgur.com/a/pM13I

    opened by wjohnson5 17
  • Modified sanitize_url to accept IPv6 addresses

    Modified sanitize_url to accept IPv6 addresses

    Also removed mailto from valid_schemes, because mailto: scheme would never get accepted as it could not pass the checks further in the function (according to urlparse, it does not contain a hostname).

    opened by k21 16
  • Make submission page's subreddit auto-completion dropdown obey over18 state

    Make submission page's subreddit auto-completion dropdown obey over18 state

    This pull request updates submission page's subreddit auto-completion dropdown to not show over18 subreddits if user's over18 pref is false, which mirrors the behavior of subreddit topic recommender bar at http://www.reddit.com/subreddit (See: https://github.com/reddit/reddit/blob/master/r2/r2/controllers/api.py#L3179).

    Steps to reproduce:

    1. login to reddit
    2. uncheck the over18 pref checkbox
    3. go to the submission page and type "pics" into the subreddit input text field

    Expected result:

    The auto-completion dropdown box shows a list of non-over18 subreddits that have "pics" as their prefix.

    Actual result:

    The auto-completion dropdown shows the following subreddits:

    • pics
    • picsofmenwiththings
    • picsofharlequincats
    • PicsOfHorseDicks [over18]
    • PicsOfCanineVaginas [over18]
    • Picsofryanrunning
    • picsofnathancowley
    • picsofporn [over18]
    • picsofdannyjsleeping
    • PicsOfStonedMexicans

    The proposed update makes it so that those subreddits only show up if they have set their account's over18 pref to true.

    Lastly, it does so without breaking existing API clients by preserving the previous behavior as the default option for POST_search_reddit_names.

    opened by buddydvd 15
  • Bug fixes and improvements to proxy support

    Bug fixes and improvements to proxy support

    1. Make IPs trusted for evaluating X-Forwarded-For configurable with new INI keyword trusted_proxy_ranges, a comma-separated list of CIDR specs (or bare IPs). Move hard-coded trusted IPs 127.0.0.1 or 10.0.0.0/8 into example.ini.
    2. Bug fixes in X-Forwarded-For processing:
      • remove whitespace around extracted IP which causes the memcached exception 'bad key' (see [1] for an example stacktrace)
      • extract correct IP when multiple IPs are present. The de facto spec[2] says that each proxy appends its peer's IP, which means the original requestor is the first IP, not the last.

    [1] http://pastebin.com/1QQiRsgs

    In this instance, the request is https terminated by nginx and then routed to Reddit via Varnish cache (instead of HAProxy) which automatically appends the remote IP per the de facto spec[2] for the X-Forwarded-For header.

    Because there are effectively two proxies involved, the XFF header contains two IP addresses separated by a comma and a space. Having instrumented lib/cache.py:634, argument keys contained (note the leading whitespace) [' 127.0.0.1']. See the stack trace for the original contents of the XFF header.

    [2] X-Forwarded-For is an uncodifed, de facto standard (now replaced by RFC 7239), however there are a number of reputable resources that show how it is supposed to work, for example:

    http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/x-forwarded-headers.html#x-forwarded-for https://www.citrix.com/blogs/2012/09/27/multiple-xff-ips/

    opened by strix-technica 14
  • Don't make things with NSFW in the title forced

    Don't make things with NSFW in the title forced

    Resolves this. This allows for posts that have nsfw in the title to determine the over_18 attribute, once, at creation, instead of forcing posts to be nsfw via the over_18 attribute "or" the fact that it has the phrase "nsfw" in some form. Because of the fact that it only does this at creation, the over_18 attribute can be changed successfully, and the previous or statement takes no effect (and as such is removed).

    Edit: Just realized the logic is ever so slightly off, so don't merge yet. As it is, any currently made nsfw post that doesn't have nsfw in the title may be auto unnsfwd, due to me adding the dummy check and that check is added, and then when the check needs to run the first time it will determine over_18 only based on the property. A check for if not self.over_18 before setting over_18 should correct it though, or you can do some server side magic to get all current nsfw submissions and set their over_18 value to True after implementing.

    opened by 13steinj 14
  • Add travis integration

    Add travis integration

    The only way to test travis is to deploy to master with a .travis.yml file and wait for travis-ci to pick up the change. To do some pre-testing here, the Vagrantfile has been split into two distinct machines:

    • default is, as before, the full reddit build (we have an opportunity to rename this)
    • travis is a minimal install with only the packages and services required to run nosetests against the codebase. It tries to mimic what will happen when we try to build this on travis-ci's workers.

    As part of this addition, I've moved install-reddit.sh to install/reddit.sh and populated that install folder with common scripts used for both default and travis builds.

    opened by KeyserSosa 11
  • wiki: Add wiki renderers.

    wiki: Add wiki renderers.

    Ensures sidebar/description validate with the correct vmarkdown, monospaces/codes stylesheet, renders sidebar/description using regular markdown.

    Fixes #754

    opened by andre-d 11
Owner
The Reddit Archives
Projects where changes are no longer publicly published
The Reddit Archives
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
This is a cryptocurrency trading bot that analyses Reddit sentiment and places trades on Binance based on reddit post and comment sentiment. If you like this project please consider donating via brave. Thanks.

This is a cryptocurrency trading bot that analyses Reddit sentiment and places trades on Binance based on reddit post and comment sentiment. The bot f

Andrei 157 Dec 15, 2022
A reddit bot that imitates the popular reddit bot "u/repostsleuthbot" to trick people into clicking on a rickroll

Reddit-Rickroll-Bot A reddit bot that imitates the popular reddit bot "u/repostsleuthbot" to trick people into clicking on a rickroll Made with The Py

null 0 Jul 16, 2022
TuShare is a utility for crawling historical data of China stocks

TuShare Tushare Pro版已发布,请访问新的官网了解和查询数据接口! https://tushare.pro TuShare是实现对股票/期货等金融数据从数据采集、清洗加工 到 数据存储过程的工具,满足金融量化分析师和学习数据分析的人在数据获取方面的需求,它的特点是数据覆盖范围广,接口

挖地兔 11.9k Dec 30, 2022
An automated tool that fetches information about your crypto stake and generates historical data in time.

Introduction Yield explorer is a WIP! I needed a tool that would show me historical data and performance of my staked crypto but was unable to find a

Sedat Can Yalçın 42 Nov 26, 2022
Source code of u/pekofy_bot from reddit.

pekofy-bot Source code of u/pekofy_bot from reddit. Get more info about the bot here: https://www.reddit.com/user/pekofy_bot/comments/krxxol/pekofy_bo

null 32 Dec 25, 2022
See trending stock tickers on Reddit and check Stock perfomance

See trending stock tickers on Reddit and check Stock perfomance

Abbas 1.5k Jan 6, 2023
Track live sentiment for stocks from Reddit and Twitter and identify growing stocks

Market Sentiment About This repository can mainly be used for two things. a. Tracking the live sentiment of stocks from Reddit and Twitter b. Tracking

Market Sentiment 345 Dec 17, 2022
Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-reddit-bot

Ace Attorney twitter Bot Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-

Luis Mayo Valbuena 542 Dec 17, 2022
Exports saved posts and comments on Reddit to a csv file.

reddit-saved-to-csv Exports saved posts and comments on Reddit to a csv file. Columns: ID, Name, Subreddit, Type, URL, NoSFW ID: Starts from 1 and inc

null 70 Jan 2, 2023
A way to export your saved reddit posts to a Notion table.

reddit-saved-to-notion A way to export your saved reddit posts and comments to a Notion table.Uses notion-sdk-py and praw for interacting with Notion

null 19 Sep 12, 2022
Reddit cli to slack at work

Reddit CLI (v1.0) Introduction Why Reddit CLI? Coworker who sees me looking at something in a browser: "Glad you're not busy; I need you to do this, t

null 3 Jun 22, 2021
Create Fast and easy image datasets using reddit

Reddit-Image-Scraper Reddit Reddit is an American Social news aggregation, web content rating, and discussion website. Reddit has been devided by topi

Wasin Silakong 4 Apr 27, 2022
Telegram bot to scrape images from the reddit universe

Telegram bot to scrape images from the reddit universe

XD22 3 Sep 30, 2022
A replacement for Reddit /r/copypasta CummyBot2000 with extra measures to avoid it being banned.

CummyBot1984 A replacement for Reddit /r/copypasta's CummyBot2000 with extra measures to respect Reddit's API rules. Features Copies and replies to ev

null 2 Feb 21, 2022
Shred your reddit comment and post history

trasheddit Shred your reddit comment and post history (x89/Shreddit replacement) Usage Simple Example Download trasheddit: git clone https://github.co

Elly 2 Jan 5, 2022
Mini Tool to lovers of debe from eksisozluk (one of the most famous website -reffered as collaborative dictionary like reddit- in Turkey) for pushing debe (Most Liked Entries of Yesterday) to kindle every day via Github Actions.

debe to kindle Mini Tool to lovers of debe from eksisozluk (one of the most famous website -refered as collaborative dictionary like reddit- in Turkey

null 11 Oct 11, 2022
Reddit bot that uses sentiment analysis

Reddit Bot Project 2: Neural Network Boogaloo Reddit bot that uses sentiment analysis from NLTK.VADER WIP_WIP_WIP_WIP_WIP_WIP Link to test subreddit:

TpK 1 Oct 24, 2021
Reddit comment bot emulating Telugu actor N. Bala Krishna.

Balayya-Bot Reddit comment bot emulating Telugu actor N. Bala Krishna. Project structure config.py contains Bot's higher level configuration. generate

Kari Lorince 2 Nov 5, 2021