https://github.com/maxim-mazurok/phantomjs-reddit-programmer-humor-parser
Parse r/ProgrammerHumor from Reddit using PhantomJS in NodeJS
https://github.com/maxim-mazurok/phantomjs-reddit-programmer-humor-parser
jquery node-js nodejs parser phantomjs phantomjs-node reddit
Last synced: 2 months ago
JSON representation
Parse r/ProgrammerHumor from Reddit using PhantomJS in NodeJS
- Host: GitHub
- URL: https://github.com/maxim-mazurok/phantomjs-reddit-programmer-humor-parser
- Owner: Maxim-Mazurok
- License: mit
- Created: 2018-03-15T18:12:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-05T09:14:41.000Z (about 5 years ago)
- Last Synced: 2025-01-18T15:30:20.206Z (4 months ago)
- Topics: jquery, node-js, nodejs, parser, phantomjs, phantomjs-node, reddit
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PhantomJS Reddit ProgrammerHumor Parser
Parse [r/ProgrammerHumor](https://www.reddit.com/r/ProgrammerHumor/) from Reddit
using [PhantomJS](https://www.npmjs.com/package/phantom)
in [NodeJS](https://nodejs.org/),
sort titles depending on likes and output as a JSON.**Important**: PhantomJS development is suspended until further notice ([more details](https://github.com/ariya/phantomjs/issues/15344)).
## Getting started
1. Clone:
```bash
git clone https://github.com/Maxim-Mazurok/phantomjs-reddit-programmer-humor-parser
```
2. Install dependencies:
```bash
cd phantomjs-reddit-programmer-humor-parser && npm install
```
3. Run:
```bash
npm start
```
4. Example output:
```JSON
[
{
"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](https://heroku.com)## 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](https://trademarks.justia.com/864/21/reddit-86421757.html)
of [Reddit Corporation](https://www.reddit.com/)