Reddinx: A reddit indexer
Β Search your favorite subreddit with Algolia
Who am I?
Tim Carry
Full-Stack Engineer at
Previously at
Used to work here
Actually, used to co-organize this event, so very happy to be able to be part of it again
I also love to gather a bunch of friends, sit around and play Dungeons & Dragons
As the gamemaster, I like to create stories to engage my players
Have them in fantastic locations, like in a flying city, in the heart of a volcano or a haunted manor
Great way to spark the imagination is to have a map to share
reddit.com/r/dndmaps π
Free
Updated daily
Amateur and pro quality
Great source of inspiration
reddit.com/search π©
Slow
No typo tolerance
Frustrating to use
Visually cluttered results
api.reddit.com π€
api.reddit.com/api/info/
?
id
=
t3_
hvjxtn
{
"id": "hvjxtn",
"title": "Dragonship - A living forest dragon pirate ship - Made in Inkarnate - 44 x 33",
"permalink": "/r/dndmaps/comments/hvjxtn/dragonship_a_living_forest_dragon_pirate_ship/",
"thumbnail": "https://b.thumbs.redditmedia.com/9psU-VI15Vf2AnWG6cJ5SA6djUKoPY4a_IlYo09_9MU.jpg",
"created": 1595408294.0,
"score": 116,
"subreddit": "dndmaps",
"author": "crashgem",
"ups": 116,
}
3 major steps
Fetching the
initial
data
1. Fetching the initial data
api.reddit.com
Details of a post
History of a subreddit
api.pushshift.io
Details of a post
History of a subreddit
data
βββ 2017
βΒ Β βββ 01
βΒ Β βββ 02
βΒ Β βββ 03
β β βββ t3_6a0f2s.json
β β βββ t3_6a0o4n.json
β β βββ t3_6a7au5.json
β β βββ t3_6aex01.json
β β βββ t3_6aype2.json
β β βββ t3_6azfnv.json
β β βββ t3_6b6zev.json
β β βββ t3_6bbdis.json
β β βββ t3_6bj0y9.json
βΒ Β βββ 04
βΒ Β βββ 05
βΒ Β βββ 06
βΒ Β βββ 07
βΒ Β βββ 08
βΒ Β βββ 09
βΒ Β βββ 10
βΒ Β βββ 11
βΒ Β βββ 12
βββ 2018
βΒ Β βββ 01
βΒ Β βββ 02
βΒ Β βββ 03
βΒ Β βββ 04
βΒ Β βββ 05
{
"id": "t3_hvjxtn",
"title": "Dragonship - A living forest dragon pirate ship - Made in Inkarnate - 44 x 33",
"url": "https://www.reddit.com/r/dndmaps/comments/hvjxtn/dragonship_a_living_forest_dragon_pirate_ship/",
"author": {
"id": "t2_c5ezw",
"name": "crashgem"
},
"picture": {
"full": "https://preview.redd.it/42epgdrp4bc51.jpg?auto=webp&s=515cbdf60a128fbfae0e7c191b60e2b737988a92",
"preview": "https://preview.redd.it/42epgdrp4bc51.jpg?width=640&crop=smart&auto=webp&s=cf1bb269ef5c065da05242b79bc263a4d00553e8",
"thumbnail": "https://b.thumbs.redditmedia.com/9psU-VI15Vf2AnWG6cJ5SA6djUKoPY4a_IlYo09_9MU.jpg"
},
"score": {
"comments": 4,
"downs": 0,
"ratio": 1,
"ups": 110,
"value": 110
},
"tags": ["Vessel"],
}
2. Keeping data fresh
Frequency
How often do you want to update the data?
Every day
Quantity
How far back do you want to update the data?
Up to 7 days
3. Building the Search UI
Infinite scroll
Masonry effect
3. Building the Search UI: Infinite Scroll
// Javascript
widgets.infiniteHits()
IntersectionObserver()
3. Building the Search UI: Masonry effect
/* CSS */
grid-auto-rows: 10px
// Javascript
onHeightChange()
Open-Source
// Load it as an npm module
const reddinx = require('reddinx');
// Pick any subreddit
const subredditName = 'dndmaps';
// Fetch initial data
await reddinx.initial(subredditName);
// Keep data fresh
await reddinx.incremental(subredditName);