Skip to content

Maxim-Mazurok/phantomjs-reddit-programmer-humor-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhantomJS Reddit ProgrammerHumor Parser

Parse r/ProgrammerHumor from Reddit using PhantomJS in NodeJS, sort titles depending on likes and output as a JSON.

Important: PhantomJS development is suspended until further notice (more details).

Getting started

  1. Clone:
git clone https://github.com/Maxim-Mazurok/phantomjs-reddit-programmer-humor-parser
  1. Install dependencies:
cd phantomjs-reddit-programmer-humor-parser && npm install
  1. Run:
npm start
  1. Example output:
[
  {
    "likes": 1900,
    "title": "When asking that one coworker about their favourite IDE"
  },
  {
    "likes": 2000,
    "title": "Everybody loves JS. Part 2"
  },
  {
    "likes": 2800,
    "title": "how to build a horse with Programming"
  },
  {
    "likes": 3000,
    "title": "#10YearChallenge"
  },
  {
    "likes": 6800,
    "title": "Wait a second... I did this before..."
  },
  {
    "likes": 50400,
    "title": "Spotted on GitHub 🤓"
  },
  {
    "likes": 153000,
    "title": "UML diagram / Source code"
  },
  {
    "likes": 176000,
    "title": "How to learn programming in one day"
  },
  {
    "likes": 176000,
    "title": "I was told there would be karma on cake day"
  },
  {
    "likes": 177000,
    "title": "But if they do it in the movies..."
  },
  {
    "likes": 254000,
    "title": "somebody did an oopsie"
  },
  {
    "likes": 286000,
    "title": "Survey for our Upcoming Hackathon"
  },
  {
    "likes": 459000,
    "title": "REMINDER: This is NOT a general tech humor subreddit"
  },
  {
    "likes": 802000,
    "title": "And what was your first step?"
  },
  {
    "likes": 913000,
    "title": "Truly a miracle"
  }
]

TODO:

  • Use promises to wait for jQuery to load, or get rid of it
  • Make it less spaghetti, probably create helper functions
  • Create an HTML-output demo
  • Deploy demo to Heroku

Disclaimer:

This project was created only in educational purposes.

It may not work later, if Reddit changes their HTML markup.


"Reddit" is a registered trademark of Reddit Corporation

About

Parse r/ProgrammerHumor from Reddit using PhantomJS in NodeJS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published