nothing here yet...
You can get JSON or RSS feed for subreddits and users by adding query parameters to the URL. For example:
- https://teddit.net/?api - return JSON for the frontpage
- https://teddit.net/?api&type=rss - return RSS for the frontpage
- https://teddit.net/r/privacy?api - return JSON for the /r/privacy
- https://teddit.net/r/privacy?api&type=rss - return RSS for the /r/privacy
- https://teddit.net/u/dEBRUYNE_1?api&type=rss - return RSS for the /u/dEBRUYNE_1
- https://teddit.net/u/fluffyponyza?sort=top&t=year&api&type=rss - return RSS for the /u/fluffyponyza, sorted as top feed from past year
You can get full size post images in the subreddit RSS feeds with a query parameter
full_thumbs. For example:
In case you want the same JSON response what you get from the official Reddit API, you can get it from teddit API by adding query string
&target=reddit. For example:
- https://teddit.net/?api&target=reddit - return Reddit JSON for the frontpage
raw_json=1 query parameter you can get raw JSON response (disables the encoding of <, >, and &). For example:
mode=light query parameter the
selftext_html key will be emptied, making the JSON/RSS significantly smaller.
After successfully setuping your instance, it's a good idea to add
maxmemory-policy configs to your redis.conf. For example:
redis.conf file and set
maxmemory value suitable for your server (e.g. 75% of your total RAM):
# nano /etc/redis/redis.conf
Add this to the end of the file:
Save and exit.
# systemctl restart redis
nothing here yet...
Note that teddit doesn't remove any cached media files (images & videos) from the server. For time being you have to manually delete files if you are running low disk space.
OAuth vs non-OAuth
In the config file
config.js you can set the
use_reddit_oauth key to
false. If the key is set to
true, teddit will use Reddit's API with OAuth (Reddit APP id
reddit_app_id is needed in the config file). If it's set to
false, teddit will use Reddit's API without OAuth (no Reddit APP id needed). Note: If you don't use Reddit OAuth, you might experience unexpected errors (rate limiting). The key is set to
false by default.