Gathering detailed insights and metrics for fetch-subreddit
Gathering detailed insights and metrics for fetch-subreddit
Gathering detailed insights and metrics for fetch-subreddit
Gathering detailed insights and metrics for fetch-subreddit
fetch-reddit-plugin
Used to fetch simplified reddit posts from a specific subreddit
reddit-explorer
Simple reddit client that allows to fetch reddit names and content from any subreddit, without any account authentication.
reddit-fetch-json
Get the JSON from any given subreddit without oauth certificates.
musakui
An easy to use module to fetch random posts from any subreddit
npm install fetch-subreddit
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
WTFPL License
5 Stars
16 Commits
1 Forks
2 Watchers
2 Branches
1 Contributors
Updated on Jan 08, 2023
Latest Version
3.0.0
Package Id
fetch-subreddit@3.0.0
Size
7.14 kB
NPM Version
3.10.3
Node Version
6.3.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
Fetch a Reddit subreddit as JSON.
Also allows you to grab random subreddits using fetchRandomSubredditName()
(via /r/random), or fetchRandomNSFWSubredditName()
(via /r/randnswf).
1$ npm i fetch-subreddit -S
fetchSubreddit(subreddits:String|Array):Array
Get a subreddit's links by subreddit name (or array of subreddit names).
1function fetchSubreddit(subreddits) {...}
fetchRandomSubredditName(count:Number):Array
Fetches count
number of "safe for work" subreddits.
1function fetchRandomSubredditName(count=1) {...}
fetchRandomNSFWSubredditName(count:Number):Array
Fetches count
number of "NOT safe for work" subreddits.
NOTE: This is a separate API just to avoid accidental work porn.
1function fetchRandomNSFWSubredditName(count=1) {...}
getSubredditName(url:String):String {
Extracts a subreddit name from a URL using sketchy RegExp.
1function getSubredditName(url) {...}
1const {fetchSubreddit} = require('fetch-subreddit'); 2 3fetchSubreddit('worldnews') 4 .then((urls) => console.log(pretty(urls))) 5 .catch((err) => console.error(err)); 6 7function pretty(obj) { 8 return JSON.stringify(obj, null, 2); 9}
Or, if you want to roll the dice on a couple random subreddits:
1const { fetchSubreddit, fetchRandomSubredditName } = require('fetch-subreddit'); 2 3// Fetch 2 random subreddits via /r/random, then grab each subreddits's JSON feed. 4fetchRandomSubredditName(2) 5 .then((res) => res.map(({name}) => name)) 6 .then((subreddits) => fetchSubreddit(subreddits)) 7 .then((res) => console.log(res)) 8 .catch((err) => console.error(err));
1[ 2 { 3 "subreddit": "worldnews", 4 "urls": [ 5 "http://www.independent.co.uk/news/business/news/apple-tax-japan-penalty-iphone-maker-forced-to-pay-fine-a7310846.html", 6 "http://www.mirror.co.uk/news/world-news/north-korea-begs-world-aid-8847251", 7 "http://www.deccanchronicle.com/world/america/160916/rescued-isis-sex-slave-nadia-murad-made-un-goodwill-ambassador.html", 8 "http://www.euronews.com/2016/09/15/bruges-beer-pipeline-becomes-reality", 9 "http://www.hurriyetdailynews.com/young-woman-assaulted-on-public-bus-in-istanbul-for-wearing-shorts-.aspx?PageID=238&NID=103947&NewsCatID=341", 10 "https://www.theguardian.com/world/2016/sep/16/third-of-saudi-airstrikes-on-yemen-have-hit-civilian-sites-data-shows", 11 "http://www.bbc.com/news/uk-37380673", 12 "https://www.theguardian.com/business/2016/sep/16/bp-modelling-great-australian-bight-oil-spill-new-south-wales", 13 "http://www.independent.co.uk/news/world/asia/pakistan-mosque-bombing-latest-mohmand-agency-killed-suicide-blast-friday-prayers-claim-a7310986.html", 14 "http://www.bbc.com/news/world-europe-37385989", 15 "https://www.algemeiner.com/2016/09/15/the-boys-in-tehran-know-israel-has-200-nukes-pointed-at-them-says-former-secretary-of-state-colin-powell-in-leaked-email/", 16 "http://www.dailymail.co.uk/news/article-3790116/Mexico-wants-build-border-wall-Central-America-illegal-immigrants.html", 17 "http://www.independent.co.uk/news/world/middle-east/egyptian-911-inside-job-state-media-war-on-terror-isis-made-up-al-ahram-noha-al-sharnoubi-columnist-a7308926.html?cmpid=facebook-post", 18 "http://www.dw.com/en/german-publican-challenges-niqab-wearer/a-19553623", 19 "http://www.independent.ie/world-news/europe/un-warns-that-235000-refugees-waiting-in-libya-to-cross-to-italy-35053194.html", 20 "http://www.independent.co.uk/news/world/americas/child-sex-sting-nets-22-suspects-including-methodist-pastor-who-volunteered-in-schools-a7311576.html", 21 "https://www.theguardian.com/uk-news/2016/sep/16/torrential-rain-travel-chaos-england-floods", 22 "https://www.thestar.com/news/world/2016/09/14/15-billion-birds-missing-from-north-american-skies-alarming-report-finds.html", 23 "http://www.nationalobserver.com/2016/09/14/news/embrace-change-un-environment-boss-tells-canadas-oil-industry", 24 "https://www.theguardian.com/society/2016/sep/15/stephen-hawking-robert-winston-inquiry-jeremy-hunt-nhs-weekend-patient-deaths", 25 "http://www.dailydot.com/layer8/julian-assange-obama-chelsea-manning/", 26 "http://www.middleeasteye.net/news/syria-us-fsa-threats-1094894190", 27 "http://www.bbc.com/news/world-asia-china-37370201", 28 "http://www.mirror.co.uk/news/weird-news/notorious-runaway-robot-escaped-lab-8846563", 29 "http://www.dw.com/en/muslim-fashion-shops-in-germany-linked-to-extremist-salafists/a-19554871" 30 ] 31 }, 32 { 33 "subreddit": "sports", 34 "urls": [ 35 "http://i.imgur.com/ZP2Xgbf.jpg", 36 "http://imgur.com/dMlrDUM", 37 "http://ftw.usatoday.com/2016/09/south-park-colin-kaepernick-anthem-protest-nfl", 38 "http://i.imgur.com/TUC50Wn.gifv", 39 "http://www.nfl.com/news/story/0ap3000000703603/article/bills-fire-offensive-coordinator-greg-roman", 40 "https://i.redd.it/3j6bdfk20ylx.jpg", 41 "http://www.cbssports.com/nfl/news/heres-the-reason-we-obsess-over-rg3-tiger-tim-tebow-and-johnny-manziel/", 42 "http://i.imgur.com/ibbpAP2.gifv", 43 "http://www.bbc.com/sport/olympics/37371735", 44 "http://www.espn.com/espn/story/_/id/17552385/online-retailer-fanatics-takes-harambe-banned-list-customized-jerseys", 45 "https://www.reddit.com/r/sports/comments/533q3x/anyone_like_arena_football_here/", 46 "http://www.bbc.co.uk/sport/olympics/37371735", 47 "https://www.reddit.com/r/sports/comments/533ie2/whats_your_favorite_gameday_feast/", 48 "http://www.bbc.com/sport/37382825", 49 "https://m.youtube.com/watch?v=wMAmhUxjsp0&feature=youtu.be", 50 "http://i.imgur.com/eyyXw2q.gif", 51 "https://twitter.com/dkurtenbach/status/775562761543688193", 52 "http://www.highlighthub.com/bills-marquise-goodwin-burns-darrelle-revis-for-84-yard-touchdown/", 53 "https://i.reddituploads.com/54cc99b31e8b48dbbec0edbe1d571e44?fit=max&h=1536&w=1536&s=8f33f9120581730492c19034fe899632", 54 "https://ca.sports.yahoo.com/photos/paralympians-listening-to-their-medals-slideshow/", 55 "http://www.nytimes.com/2016/09/11/sports/ncaafootball/wearable-technology-nike-privacy-college-football.html?smid=re-share", 56 "http://www.90min.com/posts/3792045-lionel-messi-names-the-barcelona-teammate-who-still-amazes-the-5-time-balon-d-or-winner", 57 "https://www.reddit.com/r/sports/comments/52zqqm/after_listening_to_an_old_mcenroe_interview_an/", 58 "http://adage.com/article/special-report-the-olympics/nbc-rio-olympics-quarter-billion-profit/305859/", 59 "http://www.bbc.com/sport/cycling/37371057" 60 ] 61 } 62]
You can also use the fetch-subreddit
module via the CLI, using ./bin/fetch-subreddit.js
locally during development, or by using fetch-subreddit
in ./node_modules/.bin/ if installed as a local dependency or global dependency:
1$ ./bin/fetch-subreddit.js worldnews sports 2 3{ 4 "worldnews": [ 5 "http://www.independent.co.uk/news/uk/home-news/more-than-30000-ahmadiyya-muslims-from-across-the-world-meet-in-the-uk-to-reject-isis-and-islamic-a7191306.html?cmpid=facebook-post", 6 "http://qz.com/755854/top-indian-hospitals-are-buying-kidneys-from-poor-villagers-to-sell-to-rich-patients/", 7 "http://www.foxnews.com/world/2016/08/15/isis-gets-know-nothing-recruits-and-rejoices.html", 8 "http://www.bbc.com/news/world-europe-37082637", 9 "http://www.cnbc.com/2016/08/14/ledgers-in-ukraine-show-cash-listed-for-trumps-campaign-chief-manafort-from-yanukovychs-party-nyt.html", 10 "http://abcnews.go.com/International/wireStory/iraqi-men-arrested-years-day-rape-austria-41392461", 11 "http://www.independent.co.uk/news/world/europe/charlie-hebdo-faces-fresh-death-threats-after-publishing-image-of-naked-muslims-a7190276.html", 12 "http://www.independent.co.uk/news/world/europe/italy-seeks-new-deal-to-scrap-eu-austerity-as-its-economy-stalls-a7189936.html", 13 "http://www.nbcnews.com/news/world/south-sudan-troops-raped-beat-foreigners-u-n-force-ignored-n630876", 14 "http://www.bbc.com/news/world-latin-america-37077172?ns_mchannel=social&ns_campaign=bbc_breaking&ns_source=twitter&ns_linkname=news_central", 15 "http://www.csmonitor.com/World/2016/0814/Iraqi-Kurds-take-several-villages-on-advance-towards-Mosul", 16 "http://www.dailymail.co.uk/news/article-3738732/Merkel-urge-chiefs-big-companies-hire-refugees-Bild-reports.html", 17 "http://www.independent.co.uk/news/science/archaeology/revealed-remarkable-ancient-structure-found-just-two-miles-from-stonehenge-a7190476.html", 18 "http://www.ibtimes.co.uk/julian-assange-wikileaks-will-show-how-us-intelligence-interferes-european-elections-1575387", 19 "http://www.i24news.tv/en/news/israel/122691-160814-2-000-year-old-synagogue-discovered-in-galilee", 20 "http://www.businessinsider.com/shadow-brokers-claims-to-hack-equation-group-group-linked-to-nsa-2016-8?r=UK&IR=T", 21 "https://weather.com/news/climate/news/july-2016-warmest-global-temperature-record", 22 "https://www.theguardian.com/uk-news/2016/aug/15/woman-jailed-for-faking-childrens-illnesses-to-claim-benefits", 23 "https://www.theguardian.com/world/2016/aug/15/kew-gardens-in-race-to-collect-and-preserve-madagascars-seeds", 24 "http://www.sunstar.com.ph/manila/local-news/2016/08/15/duterte-tells-isis-i-can-do-it-10-times-better-you-491600", 25 "http://www.japantimes.co.jp/news/2016/08/15/national/politics-diplomacy/emperor-expresses-deep-remorse-for-war-on-71st-anniversary-of-surrender-abe-does-not/#.V7Gc9Efr3IU", 26 "http://www.smh.com.au/federal-politics/political-news/wake-up-aussies-farright-pauline-hanson-supporters-dressed-as-muslims-storm-church-20160814-gqsclh.html", 27 "http://sputniknews.com/africa/20160814/1044254871/congo-massacre-kivu.html", 28 "https://www.theguardian.com/australia-news/2016/aug/15/eric-abetz-says-the-phrase-angry-white-man-is-racial-vilification", 29 "http://www.politico.eu/article/turkish-minister-europe-is-humiliating-us-coup-mevlut-cavusoglu/?" 30 ], 31 "sports": [ 32 "https://www.reddit.com/r/sports/comments/4whzfc/the_reddit_rio_olympics_2016_medal_tracker/", 33 "http://imgur.com/a/xcmuH", 34 "http://i.imgur.com/Xqg4g7w.gifv", 35 "https://i.reddituploads.com/27031f0b5ffa4860a1f11508778dcd7b?fit=max&h=1536&w=1536&s=1700132ce52b15d284c6dfb88196e8c2", 36 "http://www.bbc.co.uk/sport/olympics/36689475", 37 "https://www.rio2016.com/en/athletics-womens-hammer-throw-final", 38 "http://i.imgur.com/c934R2c.gifv", 39 "http://www.bbc.co.uk/sport/olympics/36689353", 40 "http://www.nbcnewyork.com/news/national-international/US-Womens-Field-Hockey-Germany-Day-10-Rio-390193961.html", 41 "http://www.bbc.com/news/uk-england-37082207", 42 "https://www.youtube.com/watch?v=SJrqwlLPF9M", 43 "http://www.local10.com/sports/former-gm-marlins-to-sign-alex-rodriguez", 44 "https://www.yahoo.com/sports/news/cubs-use-incredibly-insensitive-song-after-aroldis-chapman-outing-154609104.html", 45 "http://www.krem.com/news/local/kootenai-county/cda-mj-gets-special-delivery-from-his-idol/296314810", 46 "http://www.usatoday.com/story/sports/olympics/rio-2016/2016/08/14/olympic-swimmer-ryan-lochte-held-up-gunpoint-rio/88715436/", 47 "http://www.theglobeandmail.com/sports/olympics/a-triple-whammy-estonian-triplets-looking-to-boost-nations-profile-in-rio/article31403871/", 48 "http://www.faz.net/aktuell/sport/olympia/deutscher-kanu-trainer-stefan-henze-gestorben-14389069.html", 49 "https://i.reddituploads.com/720256425f43411c8959d0884cbc6b30?fit=max&h=1536&w=1536&s=5bde6c8901f64ae8d68746b72b3aeacd", 50 "http://www.abc.net.au/news/2016-08-14/olympics-skatetboarding-in-2020-tokyo-games-raises-drug-concerns/7733010", 51 "https://i.reddituploads.com/2112d990a7f34853968f492000dd0148?fit=max&h=1536&w=1536&s=1f2923f84b2b2959f6a40f84fbbd7d34", 52 "http://www.bbc.co.uk/news/magazine-37064144", 53 "http://www.gq.com/story/cam-newton-versace-pants-race-and-football", 54 "http://www.nbcconnecticut.com/news/sports/Forget-the-Flowers-Medal-Winners-Receive-Sculpture-Instead-390144142.html?", 55 "https://www.theguardian.com/media/2016/aug/15/bbc-john-inverdale-olympic-tennis-steve-redgrave", 56 "http://www.nbcolympics.com/news/chinese-diver-he-zi-wins-silver-3m-gold-love-marriage-proposal", 57 "https://www.reddit.com/r/sports/comments/4xv8g4/how_are_athletes_tested_for_doping_in_closed/" 58 ] 59}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/14 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More