diff --git a/.glitch-assets b/.glitch-assets new file mode 100644 index 0000000..eccbf59 --- /dev/null +++ b/.glitch-assets @@ -0,0 +1,7 @@ +{"name":"drag-in-files.svg","date":"2016-10-22T16:17:49.954Z","url":"https://cdn.hyperdev.com/drag-in-files.svg","type":"image/svg","size":7646,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/drag-in-files.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(102, 153, 205)","uuid":"adSBq97hhhpFNUna"} +{"name":"click-me.svg","date":"2016-10-23T16:17:49.954Z","url":"https://cdn.hyperdev.com/click-me.svg","type":"image/svg","size":7116,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/click-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(243, 185, 186)","uuid":"adSBq97hhhpFNUnb"} +{"name":"paste-me.svg","date":"2016-10-24T16:17:49.954Z","url":"https://cdn.hyperdev.com/paste-me.svg","type":"image/svg","size":7242,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/paste-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(42, 179, 185)","uuid":"adSBq97hhhpFNUnc"} +{"uuid":"adSBq97hhhpFNUna","deleted":true} +{"uuid":"adSBq97hhhpFNUnb","deleted":true} +{"uuid":"adSBq97hhhpFNUnc","deleted":true} +{"name":"favicon.png","date":"2018-04-30T18:43:27.513Z","url":"https://cdn.glitch.com/9fc6105a-f8fb-44e4-ae43-fb7f802d3b2f%2Ffavicon.png","type":"image/png","size":15349,"imageWidth":312,"imageHeight":312,"thumbnail":"https://cdn.glitch.com/9fc6105a-f8fb-44e4-ae43-fb7f802d3b2f%2Ffavicon.png","thumbnailWidth":312,"thumbnailHeight":312,"dominantColor":"rgb(252,252,252)","uuid":"oiV2ZzYRqh73R90P"} diff --git a/404.html b/404.html new file mode 100644 index 0000000..08cd576 --- /dev/null +++ b/404.html @@ -0,0 +1,11 @@ + + + Not found + + +

+ Whoops, there's nothing here! +

+ Go back to the main site. + + \ No newline at end of file diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..6c2291a --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +www.arandomone.com \ No newline at end of file diff --git a/README.md b/README.md index 0486acf..2c655e2 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ -# aRandomOne \ No newline at end of file +A Random One! +================= + +_A Random One_ is a _Friends_ random episode generator which also includes Netflix links +for easy viewing. It was created to mimic the random order of re-runs on live television. + +Try it out at [Live App Website](https://stripe-impossible-duke.glitch.me/). + + +Sources +------- +- Episode descriptions are from http://www.friends-tv.org/epshort.html. +- Netflix episode URLs can be obtained/updated using the `extract-episode-urls.js` snippet +in Google Chrome. + +### To-do +- [ ] Flatten JSON file (include season in episode object) +- [x] ~Finish adding remaining seasons to JSON~ +- [ ] Add episode descriptions to JSON +- [ ] Apple TV app? diff --git a/episodes.json b/episodes.json new file mode 100644 index 0000000..fb8e182 --- /dev/null +++ b/episodes.json @@ -0,0 +1,1697 @@ +[ + { + "season": 1, + "episodes": [ + { + "episode": 1, + "title": "The One Where Monica Gets a Roommate (Pilot)", + "urls": { + "netflix": "/watch/70273997" + } + }, + { + "episode": 2, + "title": "The One with the Sonogram at the End", + "urls": { + "netflix": "/watch/70273998" + } + }, + { + "episode": 3, + "title": "The One with the Thumb", + "urls": { + "netflix": "/watch/70273999" + } + }, + { + "episode": 4, + "title": "The One with George Stephanopoulos", + "urls": { + "netflix": "/watch/70274000" + } + }, + { + "episode": 5, + "title": "The One with the East German Laundry Detergent", + "urls": { + "netflix": "/watch/70274001" + } + }, + { + "episode": 6, + "title": "The One with the Butt", + "urls": { + "netflix": "/watch/70274002" + } + }, + { + "episode": 7, + "title": "The One with the Blackout", + "urls": { + "netflix": "/watch/70274003" + } + }, + { + "episode": 8, + "title": "The One Where Nana Dies Twice", + "urls": { + "netflix": "/watch/70274004" + } + }, + { + "episode": 9, + "title": "The One Where Underdog Gets Away", + "urls": { + "netflix": "/watch/70274005" + } + }, + { + "episode": 10, + "title": "The One with the Monkey", + "urls": { + "netflix": "/watch/70274006" + } + }, + { + "episode": 11, + "title": "The One with Mrs. Bing", + "urls": { + "netflix": "/watch/70274007" + } + }, + { + "episode": 12, + "title": "The One with the Dozen Lasagnas", + "urls": { + "netflix": "/watch/70274008" + } + }, + { + "episode": 13, + "title": "The One with the Boobies", + "urls": { + "netflix": "/watch/70274009" + } + }, + { + "episode": 14, + "title": "The One with the Candy Hearts", + "urls": { + "netflix": "/watch/70274010" + } + }, + { + "episode": 15, + "title": "The One with the Stoned Guy", + "urls": { + "netflix": "/watch/70274011" + } + }, + { + "episode": 16, + "title": "The One with the Two Parts: Part 1", + "urls": { + "netflix": "/watch/70274012" + } + }, + { + "episode": 17, + "title": "The One with the Two Parts: Part 2", + "urls": { + "netflix": "/watch/70274013" + } + }, + { + "episode": 18, + "title": "The One with All the Poker", + "urls": { + "netflix": "/watch/70274014" + } + }, + { + "episode": 19, + "title": "The One Where the Monkey Gets Away", + "urls": { + "netflix": "/watch/70274015" + } + }, + { + "episode": 20, + "title": "The One with the Evil Orthodontist", + "urls": { + "netflix": "/watch/70274016" + } + }, + { + "episode": 21, + "title": "The One with the Fake Monica", + "urls": { + "netflix": "/watch/70274017" + } + }, + { + "episode": 22, + "title": "The One with the Ick Factor", + "urls": { + "netflix": "/watch/70274018" + } + }, + { + "episode": 23, + "title": "The One with the Birth", + "urls": { + "netflix": "/watch/70274019" + } + }, + { + "episode": 24, + "title": "The One Where Rachel Finds Out", + "urls": { + "netflix": "/watch/70274020" + } + } + ] + }, + { + "season": 2, + "episodes": [ + { + "episode": 1, + "title": "The One with Ross's New Girlfriend", + "urls": { + "netflix": "/watch/70274021" + } + }, + { + "episode": 2, + "title": "The One with the Breast Milk", + "urls": { + "netflix": "/watch/70274022" + } + }, + { + "episode": 3, + "title": "The One Where Heckles Dies", + "urls": { + "netflix": "/watch/70274023" + } + }, + { + "episode": 4, + "title": "The One with Phoebe's Husband", + "urls": { + "netflix": "/watch/70274024" + } + }, + { + "episode": 5, + "title": "The One with Five Steaks and an Eggplant", + "urls": { + "netflix": "/watch/70274025" + } + }, + { + "episode": 6, + "title": "The One with the Baby on the Bus", + "urls": { + "netflix": "/watch/70274026" + } + }, + { + "episode": 7, + "title": "The One Where Ross Finds Out", + "urls": { + "netflix": "/watch/70274027" + } + }, + { + "episode": 8, + "title": "The One with the List", + "urls": { + "netflix": "/watch/70274028" + } + }, + { + "episode": 9, + "title": "The One with Phoebe's Dad", + "urls": { + "netflix": "/watch/70274029" + } + }, + { + "episode": 10, + "title": "The One with Russ", + "urls": { + "netflix": "/watch/70274030" + } + }, + { + "episode": 11, + "title": "The One with the Lesbian Wedding", + "urls": { + "netflix": "/watch/70274031" + } + }, + { + "episode": 12, + "title": "The One After the Super Bowl: Part 1", + "urls": { + "netflix": "/watch/70274032" + } + }, + { + "episode": 13, + "title": "The One After the Super Bowl: Part 2", + "urls": { + "netflix": "/watch/70274033" + } + }, + { + "episode": 14, + "title": "The One with the Prom Video", + "urls": { + "netflix": "/watch/70274034" + } + }, + { + "episode": 15, + "title": "The One Where Ross and Rachel...You Know", + "urls": { + "netflix": "/watch/70274035" + } + }, + { + "episode": 16, + "title": "The One Where Joey Moves Out", + "urls": { + "netflix": "/watch/70274036" + } + }, + { + "episode": 17, + "title": "The One Where Eddie Moves In", + "urls": { + "netflix": "/watch/70274037" + } + }, + { + "episode": 18, + "title": "The One Where Dr. Ramoray Dies", + "urls": { + "netflix": "/watch/70274038" + } + }, + { + "episode": 19, + "title": "The One Where Eddie Won't Go", + "urls": { + "netflix": "/watch/70274039" + } + }, + { + "episode": 20, + "title": "The One Where Old Yeller Dies", + "urls": { + "netflix": "/watch/70274040" + } + }, + { + "episode": 21, + "title": "The One with the Bullies", + "urls": { + "netflix": "/watch/70274041" + } + }, + { + "episode": 22, + "title": "The One with the Two Parties", + "urls": { + "netflix": "/watch/70274042" + } + }, + { + "episode": 23, + "title": "The One with the Chicken Pox", + "urls": { + "netflix": "/watch/70274043" + } + }, + { + "episode": 24, + "title": "The One with Barry and Mindy's Wedding", + "urls": { + "netflix": "/watch/70274044" + } + } + ] + }, + { + "season": 3, + "episodes": [ + { + "episode": 1, + "title": "The One with the Princess Leia Fantasy", + "urls": { + "netflix": "/watch/70274045" + } + }, + { + "episode": 2, + "title": "The One Where No One's Ready", + "urls": { + "netflix": "/watch/70274046" + } + }, + { + "episode": 3, + "title": "The One with the Jam", + "urls": { + "netflix": "/watch/70274047" + } + }, + { + "episode": 4, + "title": "The One with the Metaphorical Tunnel", + "urls": { + "netflix": "/watch/70274048" + } + }, + { + "episode": 5, + "title": "The One with Frank Jr", + "urls": { + "netflix": "/watch/70274049" + } + }, + { + "episode": 6, + "title": "The One with the Flashback", + "urls": { + "netflix": "/watch/70274050" + } + }, + { + "episode": 7, + "title": "The One with the Race Car Bed", + "urls": { + "netflix": "/watch/70274051" + } + }, + { + "episode": 8, + "title": "The One with the Giant Poking Device", + "urls": { + "netflix": "/watch/70274052" + } + }, + { + "episode": 9, + "title": "The One with the Football", + "urls": { + "netflix": "/watch/70274053" + } + }, + { + "episode": 10, + "title": "The One Where Rachel Quits", + "urls": { + "netflix": "/watch/70274054" + } + }, + { + "episode": 11, + "title": "The One Where Chandler Can't Remember Which Sister", + "urls": { + "netflix": "/watch/70274055" + } + }, + { + "episode": 12, + "title": "The One with All the Jealousy", + "urls": { + "netflix": "/watch/70274056" + } + }, + { + "episode": 13, + "title": "The One Where Monica & Richard Are Just Friends", + "urls": { + "netflix": "/watch/70274057" + } + }, + { + "episode": 14, + "title": "The One with Phoebe's Ex-Partner", + "urls": { + "netflix": "/watch/70274058" + } + }, + { + "episode": 15, + "title": "The One Where Ross & Rachel Take a Break", + "urls": { + "netflix": "/watch/70274059" + } + }, + { + "episode": 16, + "title": "The One The Morning After", + "urls": { + "netflix": "/watch/70274060" + } + }, + { + "episode": 17, + "title": "The One Without the Ski Trip", + "urls": { + "netflix": "/watch/70274061" + } + }, + { + "episode": 18, + "title": "The One with the Hypnosis Tape", + "urls": { + "netflix": "/watch/70274062" + } + }, + { + "episode": 19, + "title": "The One with the Tiny T-Shirt", + "urls": { + "netflix": "/watch/70274063" + } + }, + { + "episode": 20, + "title": "The One with the Dollhouse", + "urls": { + "netflix": "/watch/70274064" + } + }, + { + "episode": 21, + "title": "The One with a Chick. And a Duck", + "urls": { + "netflix": "/watch/70274065" + } + }, + { + "episode": 22, + "title": "The One with the Screamer", + "urls": { + "netflix": "/watch/70274066" + } + }, + { + "episode": 23, + "title": "The One with Ross's Thing", + "urls": { + "netflix": "/watch/70274067" + } + }, + { + "episode": 24, + "title": "The One with the Ultimate Fighting Champion", + "urls": { + "netflix": "/watch/70274068" + } + }, + { + "episode": 25, + "title": "The One at the Beach", + "urls": { + "netflix": "/watch/70274069" + } + } + ] + }, + { + "season": 4, + "episodes": [ + { + "episode": 1, + "title": "The One with the Jellyfish", + "urls": { + "netflix": "/watch/70274070" + } + }, + { + "episode": 2, + "title": "The One with the Cat", + "urls": { + "netflix": "/watch/70274071" + } + }, + { + "episode": 3, + "title": "The One with the 'Cuffs", + "urls": { + "netflix": "/watch/70274072" + } + }, + { + "episode": 4, + "title": "The One with the Ballroom Dancing", + "urls": { + "netflix": "/watch/70274073" + } + }, + { + "episode": 5, + "title": "The One with Joey's New Girlfriend", + "urls": { + "netflix": "/watch/70274074" + } + }, + { + "episode": 6, + "title": "The One with the Dirty Girl", + "urls": { + "netflix": "/watch/70274075" + } + }, + { + "episode": 7, + "title": "The One Where Chandler Crosses the Line", + "urls": { + "netflix": "/watch/70274076" + } + }, + { + "episode": 8, + "title": "The One with Chandler in a Box", + "urls": { + "netflix": "/watch/70274077" + } + }, + { + "episode": 9, + "title": "The One Where They're Going to Party", + "urls": { + "netflix": "/watch/70274078" + } + }, + { + "episode": 10, + "title": "The One with the Girl from Poughkeepsie", + "urls": { + "netflix": "/watch/70274079" + } + }, + { + "episode": 11, + "title": "The One with Phoebe's Uterus", + "urls": { + "netflix": "/watch/70274080" + } + }, + { + "episode": 12, + "title": "The One with the Embryos", + "urls": { + "netflix": "/watch/70274081" + } + }, + { + "episode": 13, + "title": "The One with Rachel's Crush", + "urls": { + "netflix": "/watch/70274082" + } + }, + { + "episode": 14, + "title": "The One with Joey's Dirty Day", + "urls": { + "netflix": "/watch/70274083" + } + }, + { + "episode": 15, + "title": "The One with All the Rugby", + "urls": { + "netflix": "/watch/70274084" + } + }, + { + "episode": 16, + "title": "The One with the Fake Party", + "urls": { + "netflix": "/watch/70274085" + } + }, + { + "episode": 17, + "title": "The One with the Free Porn", + "urls": { + "netflix": "/watch/70274086" + } + }, + { + "episode": 18, + "title": "The One with Rachel's New Dress", + "urls": { + "netflix": "/watch/70274087" + } + }, + { + "episode": 19, + "title": "The One with All the Haste", + "urls": { + "netflix": "/watch/70274088" + } + }, + { + "episode": 20, + "title": "The One with the Wedding Dresses", + "urls": { + "netflix": "/watch/70274089" + } + }, + { + "episode": 21, + "title": "The One with the Invitation", + "urls": { + "netflix": "/watch/70274090" + } + }, + { + "episode": 22, + "title": "The One with the Worst Best Man Ever", + "urls": { + "netflix": "/watch/70274091" + } + }, + { + "episode": 23, + "title": "The One with Ross's Wedding: Part 1", + "urls": { + "netflix": "/watch/70274092" + } + }, + { + "episode": 24, + "title": "The One with Ross's Wedding: Part 2", + "urls": { + "netflix": "/watch/70274093" + } + } + ] + }, + { + "season": 5, + "episodes": [ + { + "episode": 1, + "title": "The One After Ross Says Rachel", + "urls": { + "netflix": "/watch/70274094" + } + }, + { + "episode": 2, + "title": "The One with All the Kissing", + "urls": { + "netflix": "/watch/70274095" + } + }, + { + "episode": 3, + "title": "The One Hundredth", + "urls": { + "netflix": "/watch/70274096" + } + }, + { + "episode": 4, + "title": "The One Where Phoebe Hates PBS", + "urls": { + "netflix": "/watch/70274097" + } + }, + { + "episode": 5, + "title": "The One with the Kips", + "urls": { + "netflix": "/watch/70274098" + } + }, + { + "episode": 6, + "title": "The One with the Yeti", + "urls": { + "netflix": "/watch/70274099" + } + }, + { + "episode": 7, + "title": "The One Where Ross Moves In", + "urls": { + "netflix": "/watch/70274100" + } + }, + { + "episode": 8, + "title": "The One with All the Thanksgivings", + "urls": { + "netflix": "/watch/70274101" + } + }, + { + "episode": 9, + "title": "The One with Ross's Sandwich", + "urls": { + "netflix": "/watch/70274102" + } + }, + { + "episode": 10, + "title": "The One with the Inappropriate Sister", + "urls": { + "netflix": "/watch/70274103" + } + }, + { + "episode": 11, + "title": "The One with All the Resolutions", + "urls": { + "netflix": "/watch/70274104" + } + }, + { + "episode": 12, + "title": "The One with Chandler's Work Laugh", + "urls": { + "netflix": "/watch/70274105" + } + }, + { + "episode": 13, + "title": "The One with Joey's Bag", + "urls": { + "netflix": "/watch/70274106" + } + }, + { + "episode": 14, + "title": "The One Where Everybody Finds Out", + "urls": { + "netflix": "/watch/70274107" + } + }, + { + "episode": 15, + "title": "The One with the Girl Who Hits Joey", + "urls": { + "netflix": "/watch/70274108" + } + }, + { + "episode": 16, + "title": "The One with the Cop", + "urls": { + "netflix": "/watch/70274109" + } + }, + { + "episode": 17, + "title": "The One with Rachel's Inadvertent Kiss", + "urls": { + "netflix": "/watch/70274110" + } + }, + { + "episode": 18, + "title": "The One Where Rachel Smokes", + "urls": { + "netflix": "/watch/70274111" + } + }, + { + "episode": 19, + "title": "The One Where Ross Can't Flirt", + "urls": { + "netflix": "/watch/70274112" + } + }, + { + "episode": 20, + "title": "The One with the Ride-Along", + "urls": { + "netflix": "/watch/70274113" + } + }, + { + "episode": 21, + "title": "The One with the Ball", + "urls": { + "netflix": "/watch/70274114" + } + }, + { + "episode": 22, + "title": "The One with Joey's Big Break", + "urls": { + "netflix": "/watch/70274115" + } + }, + { + "episode": 23, + "title": "The One in Vegas: Part 1", + "urls": { + "netflix": "/watch/70274116" + } + }, + { + "episode": 24, + "title": "The One in Vegas: Part 2", + "urls": { + "netflix": "/watch/70274117" + } + } + ] + }, + { + "season": 6, + "episodes": [ + { + "episode": 1, + "title": "The One After Vegas", + "urls": { + "netflix": "/watch/70274118" + } + }, + { + "episode": 2, + "title": "The One Where Ross Hugs Rachel", + "urls": { + "netflix": "/watch/70274119" + } + }, + { + "episode": 3, + "title": "The One with Ross's Denial", + "urls": { + "netflix": "/watch/70274120" + } + }, + { + "episode": 4, + "title": "The One Where Joey Loses His Insurance", + "urls": { + "netflix": "/watch/70274121" + } + }, + { + "episode": 5, + "title": "The One with Joey's Porsche", + "urls": { + "netflix": "/watch/70274122" + } + }, + { + "episode": 6, + "title": "The One on the Last Night", + "urls": { + "netflix": "/watch/70274123" + } + }, + { + "episode": 7, + "title": "The One Where Phoebe Runs", + "urls": { + "netflix": "/watch/70274124" + } + }, + { + "episode": 8, + "title": "The One with Ross's Teeth", + "urls": { + "netflix": "/watch/70274125" + } + }, + { + "episode": 9, + "title": "The One Where Ross Got High", + "urls": { + "netflix": "/watch/70274126" + } + }, + { + "episode": 10, + "title": "The One with the Routine", + "urls": { + "netflix": "/watch/70274127" + } + }, + { + "episode": 11, + "title": "The One with the Apothecary Table", + "urls": { + "netflix": "/watch/70274128" + } + }, + { + "episode": 12, + "title": "The One with the Joke", + "urls": { + "netflix": "/watch/70274129" + } + }, + { + "episode": 13, + "title": "The One with Rachel's Sister", + "urls": { + "netflix": "/watch/70274130" + } + }, + { + "episode": 14, + "title": "The One Where Chandler Can't Cry", + "urls": { + "netflix": "/watch/70274131" + } + }, + { + "episode": 15, + "title": "The One That Could Have Been: Part 1", + "urls": { + "netflix": "/watch/70274132" + } + }, + { + "episode": 16, + "title": "The One That Could Have Been: Part 2", + "urls": { + "netflix": "/watch/70274133" + } + }, + { + "episode": 17, + "title": "The One with Unagi", + "urls": { + "netflix": "/watch/70274134" + } + }, + { + "episode": 18, + "title": "The One Where Ross Dates a Student", + "urls": { + "netflix": "/watch/70274135" + } + }, + { + "episode": 19, + "title": "The One with Joey's Fridge", + "urls": { + "netflix": "/watch/70274136" + } + }, + { + "episode": 20, + "title": "The One with Mac and C.H.E.E.S.E", + "urls": { + "netflix": "/watch/70274137" + } + }, + { + "episode": 21, + "title": "The One Where Ross Meets Elizabeth's Dad", + "urls": { + "netflix": "/watch/70274138" + } + }, + { + "episode": 22, + "title": "The One Where Paul's the Man", + "urls": { + "netflix": "/watch/70274139" + } + }, + { + "episode": 23, + "title": "The One with the Ring", + "urls": { + "netflix": "/watch/70274140" + } + }, + { + "episode": 24, + "title": "The One with the Proposal: Part 1", + "urls": { + "netflix": "/watch/70274141" + } + }, + { + "episode": 25, + "title": "The One with the Proposal: Part 2", + "urls": { + "netflix": "/watch/70274142" + } + } + ] + }, + { + "season": 7, + "episodes": [ + { + "episode": 1, + "title": "The One with Monica's Thunder", + "urls": { + "netflix": "/watch/70274143" + } + }, + { + "episode": 2, + "title": "The One with Rachel's Book", + "urls": { + "netflix": "/watch/70274144" + } + }, + { + "episode": 3, + "title": "The One with Phoebe's Cookies", + "urls": { + "netflix": "/watch/70274145" + } + }, + { + "episode": 4, + "title": "The One with Rachel's Assistant", + "urls": { + "netflix": "/watch/70274146" + } + }, + { + "episode": 5, + "title": "The One with the Engagement Picture", + "urls": { + "netflix": "/watch/70274147" + } + }, + { + "episode": 6, + "title": "The One with the Nap Partners", + "urls": { + "netflix": "/watch/70274148" + } + }, + { + "episode": 7, + "title": "The One with Ross' Library Book", + "urls": { + "netflix": "/watch/70274149" + } + }, + { + "episode": 8, + "title": "The One Where Chandler Doesn't Like Dogs", + "urls": { + "netflix": "/watch/70274150" + } + }, + { + "episode": 9, + "title": "The One with All the Candy", + "urls": { + "netflix": "/watch/70274151" + } + }, + { + "episode": 10, + "title": "The One with the Holiday Armadillo", + "urls": { + "netflix": "/watch/70274152" + } + }, + { + "episode": 11, + "title": "The One with All the Cheesecakes", + "urls": { + "netflix": "/watch/70274153" + } + }, + { + "episode": 12, + "title": "The One Where They're Up All Night", + "urls": { + "netflix": "/watch/70274154" + } + }, + { + "episode": 13, + "title": "The One Where Rosita Dies", + "urls": { + "netflix": "/watch/70274155" + } + }, + { + "episode": 14, + "title": "The One Where They All Turn Thirty", + "urls": { + "netflix": "/watch/70274156" + } + }, + { + "episode": 15, + "title": "The One with Joey's New Brain", + "urls": { + "netflix": "/watch/70274157" + } + }, + { + "episode": 16, + "title": "The One with the Truth About London", + "urls": { + "netflix": "/watch/70274158" + } + }, + { + "episode": 17, + "title": "The One with the Cheap Wedding Dress", + "urls": { + "netflix": "/watch/70274159" + } + }, + { + "episode": 18, + "title": "The One with Joey's Award", + "urls": { + "netflix": "/watch/70274160" + } + }, + { + "episode": 19, + "title": "The One with Ross and Monica's Cousin", + "urls": { + "netflix": "/watch/70274161" + } + }, + { + "episode": 20, + "title": "The One with Rachel's Big Kiss", + "urls": { + "netflix": "/watch/70274162" + } + }, + { + "episode": 21, + "title": "The One with the Vows", + "urls": { + "netflix": "/watch/70274163" + } + }, + { + "episode": 22, + "title": "The One with Chandler's Dad", + "urls": { + "netflix": "/watch/70274164" + } + }, + { + "episode": 23, + "title": "The One with Chandler and Monica's Wedding: Part 1", + "urls": { + "netflix": "/watch/70274165" + } + }, + { + "episode": 24, + "title": "The One with Chandler and Monica's Wedding: Part 2", + "urls": { + "netflix": "/watch/70274166" + } + } + ] + }, + { + "season": 8, + "episodes": [ + { + "episode": 1, + "title": "The One After I Do", + "urls": { + "netflix": "/watch/70274167" + } + }, + { + "episode": 2, + "title": "The One with the Red Sweater", + "urls": { + "netflix": "/watch/70274168" + } + }, + { + "episode": 3, + "title": "The One Where Rachel Tells ...", + "urls": { + "netflix": "/watch/70274169" + } + }, + { + "episode": 4, + "title": "The One with the Videotape", + "urls": { + "netflix": "/watch/70274170" + } + }, + { + "episode": 5, + "title": "The One with Rachel's Date", + "urls": { + "netflix": "/watch/70274171" + } + }, + { + "episode": 6, + "title": "The One with the Halloween Party", + "urls": { + "netflix": "/watch/70274172" + } + }, + { + "episode": 7, + "title": "The One with the Stain", + "urls": { + "netflix": "/watch/70274173" + } + }, + { + "episode": 8, + "title": "The One with the Stripper", + "urls": { + "netflix": "/watch/70274174" + } + }, + { + "episode": 9, + "title": "The One with the Rumor", + "urls": { + "netflix": "/watch/70274175" + } + }, + { + "episode": 10, + "title": "The One with Monica's Boots", + "urls": { + "netflix": "/watch/70274176" + } + }, + { + "episode": 11, + "title": "The One with the Creepy Holiday Card", + "urls": { + "netflix": "/watch/70274177" + } + }, + { + "episode": 12, + "title": "The One Where Joey Dates Rachel", + "urls": { + "netflix": "/watch/70274178" + } + }, + { + "episode": 13, + "title": "The One Where Chandler Takes a Bath", + "urls": { + "netflix": "/watch/70274179" + } + }, + { + "episode": 14, + "title": "The One with the Secret Closet", + "urls": { + "netflix": "/watch/70274180" + } + }, + { + "episode": 15, + "title": "The One with the Birthing Video", + "urls": { + "netflix": "/watch/70274181" + } + }, + { + "episode": 16, + "title": "The One Where Joey Tells Rachel", + "urls": { + "netflix": "/watch/70274182" + } + }, + { + "episode": 17, + "title": "The One with the Tea Leaves", + "urls": { + "netflix": "/watch/70274183" + } + }, + { + "episode": 18, + "title": "The One in Massapequa", + "urls": { + "netflix": "/watch/70274184" + } + }, + { + "episode": 19, + "title": "The One with Joey's Interview", + "urls": { + "netflix": "/watch/70274185" + } + }, + { + "episode": 20, + "title": "The One with the Baby Shower", + "urls": { + "netflix": "/watch/70274186" + } + }, + { + "episode": 21, + "title": "The One with the Cooking Class", + "urls": { + "netflix": "/watch/70274187" + } + }, + { + "episode": 22, + "title": "The One Where Rachel Is Late", + "urls": { + "netflix": "/watch/70274188" + } + }, + { + "episode": 23, + "title": "The One Where Rachel Has a Baby: Part 1", + "urls": { + "netflix": "/watch/70274189" + } + }, + { + "episode": 24, + "title": "The One Where Rachel Has a Baby: Part 2", + "urls": { + "netflix": "/watch/70274190" + } + } + ] + }, + { + "season": 9, + "episodes": [ + { + "episode": 1, + "title": "The One Where No One Proposes", + "urls": { + "netflix": "/watch/70274191" + } + }, + { + "episode": 2, + "title": "The One Where Emma Cries", + "urls": { + "netflix": "/watch/70274192" + } + }, + { + "episode": 3, + "title": "The One with the Pediatrician", + "urls": { + "netflix": "/watch/70274193" + } + }, + { + "episode": 4, + "title": "The One with the Sharks", + "urls": { + "netflix": "/watch/70274194" + } + }, + { + "episode": 5, + "title": "The One with Phoebe's Birthday Dinner", + "urls": { + "netflix": "/watch/70274195" + } + }, + { + "episode": 6, + "title": "The One with the Male Nanny", + "urls": { + "netflix": "/watch/70274196" + } + }, + { + "episode": 7, + "title": "The One with Ross' Inappropriate Song", + "urls": { + "netflix": "/watch/70274197" + } + }, + { + "episode": 8, + "title": "The One with Rachel's Other Sister", + "urls": { + "netflix": "/watch/70274198" + } + }, + { + "episode": 9, + "title": "The One with Rachel's Phone Number", + "urls": { + "netflix": "/watch/70274199" + } + }, + { + "episode": 10, + "title": "The One with Christmas in Tulsa", + "urls": { + "netflix": "/watch/70274200" + } + }, + { + "episode": 11, + "title": "The One Where Rachel Goes Back to Work", + "urls": { + "netflix": "/watch/70274201" + } + }, + { + "episode": 12, + "title": "The One with Phoebe's Rats", + "urls": { + "netflix": "/watch/70274202" + } + }, + { + "episode": 13, + "title": "The One Where Monica Sings", + "urls": { + "netflix": "/watch/70274203" + } + }, + { + "episode": 14, + "title": "The One with the Blind Dates", + "urls": { + "netflix": "/watch/70274204" + } + }, + { + "episode": 15, + "title": "The One with the Mugging", + "urls": { + "netflix": "/watch/70274205" + } + }, + { + "episode": 16, + "title": "The One with the Boob Job", + "urls": { + "netflix": "/watch/70274206" + } + }, + { + "episode": 17, + "title": "The One with the Memorial Service", + "urls": { + "netflix": "/watch/70274207" + } + }, + { + "episode": 18, + "title": "The One with the Lottery", + "urls": { + "netflix": "/watch/70274208" + } + }, + { + "episode": 19, + "title": "The One with Rachel's Dream", + "urls": { + "netflix": "/watch/70274209" + } + }, + { + "episode": 20, + "title": "The One with the Soap Opera Party", + "urls": { + "netflix": "/watch/70274210" + } + }, + { + "episode": 21, + "title": "The One with the Fertility Test", + "urls": { + "netflix": "/watch/70274211" + } + }, + { + "episode": 22, + "title": "The One with the Donor", + "urls": { + "netflix": "/watch/70274212" + } + }, + { + "episode": 23, + "title": "The One in Barbados: Part 1", + "urls": { + "netflix": "/watch/70274213" + } + }, + { + "episode": 24, + "title": "The One in Barbados: Part 2", + "urls": { + "netflix": "/watch/70274214" + } + } + ] + }, + { + "season": 10, + "episodes": [ + { + "episode": 1, + "title": "The One After Joey and Rachel Kiss", + "urls": { + "netflix": "/watch/70274215" + } + }, + { + "episode": 2, + "title": "The One Where Ross Is Fine", + "urls": { + "netflix": "/watch/70274216" + } + }, + { + "episode": 3, + "title": "The One with Ross's Tan", + "urls": { + "netflix": "/watch/70274217" + } + }, + { + "episode": 4, + "title": "The One with the Cake", + "urls": { + "netflix": "/watch/70274218" + } + }, + { + "episode": 5, + "title": "The One Where Rachel's Sister Babysits", + "urls": { + "netflix": "/watch/70274219" + } + }, + { + "episode": 6, + "title": "The One with Ross's Grant", + "urls": { + "netflix": "/watch/70274220" + } + }, + { + "episode": 7, + "title": "The One with The Home Study", + "urls": { + "netflix": "/watch/70274221" + } + }, + { + "episode": 8, + "title": "The One with the Late Thanksgiving", + "urls": { + "netflix": "/watch/70274222" + } + }, + { + "episode": 9, + "title": "The One with the Birth Mother", + "urls": { + "netflix": "/watch/70274223" + } + }, + { + "episode": 10, + "title": "The One Where Chandler Gets Caught", + "urls": { + "netflix": "/watch/70274224" + } + }, + { + "episode": 11, + "title": "The One Where the Stripper Cries", + "urls": { + "netflix": "/watch/70274225" + } + }, + { + "episode": 12, + "title": "The One with Phoebe's Wedding", + "urls": { + "netflix": "/watch/70274226" + } + }, + { + "episode": 13, + "title": "The One Where Joey Speaks French", + "urls": { + "netflix": "/watch/70274227" + } + }, + { + "episode": 14, + "title": "The One with Princess Consuela", + "urls": { + "netflix": "/watch/70274228" + } + }, + { + "episode": 15, + "title": "The One Where Estelle Dies", + "urls": { + "netflix": "/watch/70274229" + } + }, + { + "episode": 16, + "title": "The One with Rachel's Going Away Party", + "urls": { + "netflix": "/watch/70274230" + } + }, + { + "episode": 17, + "title": "The Last One: Part 1 & Part 2", + "urls": { + "netflix": "/watch/70274231" + } + } + ] + } +] diff --git a/extract-episode-urls.js b/extract-episode-urls.js new file mode 100644 index 0000000..1f61ac4 --- /dev/null +++ b/extract-episode-urls.js @@ -0,0 +1,30 @@ +/** + * A quick chrome snippet to extract video ID's from an episode list on Netflix's website. + * Use the jquerify bookmarklet before running this script: https://mreidsma.github.io/bookmarklets/jquerify.html + * Execute on a page like https://www.netflix.com/title/70153404 + * You'll need to scroll through the episodes to ensure all are captured (it usually takes two runs.) + * + * @author Cory Evan Wright + */ +// $('.episodeWrapper div[data-ui-tracking-context]').each(function(i,el) { x.push($(el).data('uiTrackingContext')); }); + +var season = { // Using var instead of let so chrome doesn't balk when re-running the script + season: parseInt($('a.sub-menu-link').text().match(/\d+/)[0]), + episodes: [] +}; + +$('.episodeWrapper div.episodeLockup').each(function(i, el) { + const $episode = $(el), + episode = { + episode: parseInt($episode.find('.episodeNumber').text()), + title: $episode.find('div.episodeTitle p').text(), + urls: { + netflix: $episode.find('a').attr('href').split('?')[0] + } + }; + + season.episodes.push(episode); +}); + +copy(JSON.stringify(season, true, 4)); +console.info('JSON copied to clipboard! Total: %s episodes.', season.episodes.length); \ No newline at end of file diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..fc5cadf Binary files /dev/null and b/favicon.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..da68be5 --- /dev/null +++ b/index.html @@ -0,0 +1,77 @@ + + + + + + + + + A Random One! + + + + + + + + + + + + + + + + + + + + + +
+

Cooking the trifle…

+ + + +

+ A Random One is a random Friends episode generator which also includes Netflix links for easy viewing. + Cutting the cord is lovely, but there's something special about the randomness of re-runs. + A Random One is here to bring that back. +

+ + + +
+ + + diff --git a/logotype.png b/logotype.png new file mode 100644 index 0000000..2aaa629 Binary files /dev/null and b/logotype.png differ diff --git a/script.js b/script.js new file mode 100644 index 0000000..68c5452 --- /dev/null +++ b/script.js @@ -0,0 +1,86 @@ +window.episodes = []; + +var headings = [ + "Remember this one?", + "Oh, this one is great!", + "I love this one!" +]; + +var getEpisodes = function() { + $.getJSON('/episodes.json', function(episodes) { + console.info('Episodes loaded!', episodes); + window.episodes = episodes; + }) + .done(function() { + init(); + }) + .fail(function() { + $('.card').replaceWith(''); + }); +}; + +var randomItem = function(array) { + return array[Math.floor(Math.random() * array.length)]; +}; + +var getRandomEpisode = function() { + var season = randomItem(window.episodes), + episode = randomItem(season.episodes); + + // add logic to make sure the first episode in 2-part episodes always comes first? + + console.log('random episode: ', season.season, episode); + + // Update the URLs + $('.card a') + .attr('href', 'https://www.netflix.com' + episode.urls.netflix) + .eq(0).text('S' + season.season + ' E' + episode.episode + ' - ' + episode.title); + + // Update the header + $('h1').text(randomItem(headings)); + + // Update the elements for data tracking + $('a, button', '.card').data({ + episode: episode.episode + ' - ' + episode.title, + season: season.season + }); + + // TODO: Add episode descriptions to JSON and load them into card +}; + +// event tracking +var trackCardClick = function($target) { + var action = $target.data('gaAction'); + var label = $target.data('episode'); + var value = $target.data('season'); + var event = { + eventCategory: 'Card Click', + eventAction: action, // button or link action + eventLabel: label, // episode number and name + eventValue: value // season + }; + + window.ga('send', 'event', event); +}; + +// I don't love this name. What's better, or is there a better way to do this altogether? +var init = function() { + getRandomEpisode(); + + // Show the card if hidden + $('.card.hidden').removeClass('hidden'); + + // Bind UI handlers + $('a, button', '.card').on('click', function() { + trackCardClick($(this)); + }); + + $('.card button').on('click', function() { + getRandomEpisode(); + }); +}; + +// All set, let's go! +$(function() { + getEpisodes(); +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..c8dbc7f --- /dev/null +++ b/style.css @@ -0,0 +1,46 @@ +body { + margin: 1em; + font-family: 'Open Sans', helvetica, sans-serif; +} + +body h1 { + color: #58bad4; + font-size: 3em; + font-family: 'Henny Penny', cursive; + filter: drop-shadow(-1px 1px 0px #000); +} + +h3, h3 a { + color: #000; + font-size: 1.3em; + font-weight: normal; + font-family: 'Covered By Your Grace', cursive; +} + +.container { + max-width: 1000px; + margin: 0 auto; +} + +.container > footer { + color: #CCC; + font-size: .8em; + margin-top: 4em; + padding-top: .8em; + text-align: center; + border-top: 1px solid #CCC; +} + +.container > footer a { + color: #AAA; +} + +@media(min-width: 501px) { + .container > footer a:first-child { + text-align: left; + } + + .container > footer a:last-child { + text-align: right; + } +}