d-forde-scraper
v0.1.1
Published
Web Scrapper created for Web Apps Assignment 2
Downloads
2
Readme
#About This package was created as part of an assignment based around creating and publishing an NPM package.
#Current functionality Scrape a reddit page in order to get top posts, their score, username, link, subreddit name.
Scrape a youtube search in order to get video details such as title, user channel,
#Future functionality
- I'm currently working on trying to get support for other sites.
- Potentially allow for users to run the scraper from command line.
#Example code use
var scrape = require('d-forde-scraper')
//Reddit Example
var limit=45;
var url ="/r/movies";
var pages = 2; // Each page = 25 results So 45 results is on 2 pages | 70 = 3 pages etc...
scrape.scrapeReddit(url, limit, pages);
//Youtube Search scrape
term = "cats in hats";
filename ="youtube";
scrape.scrapeYoutube(term, 3, filename);
#Example Reddit.json
{
"rank": "2",
"subreddit": "movies",
"title": "LeBron James' 'Space Jam' Sequel Finds Director with Justin Lin",
"link": "http://www.hollywoodreporter.com/news/space-jam-sequel-finds-director-834978?utm_source=Sailthru&utm_medium=email&utm_campaign=THR%20Breaking%20News_now_2016-05-02%2010:39:52_rford&utm_term=hollywoodreporter_breakingnews",
"score": "3938",
"user": "Chrisortiz"
}{
"rank": "3",
"subreddit": "movies",
"title": "'The Neon Demon' Official Poster",
"link": "http://i.imgur.com/ePOfXbs.jpg",
"score": "2984",
"user": "filmfanatic5"
}{
"rank": "4",
"subreddit": "movies",
"title": "Ironhead studios has been behind or taken part in costume design for many of the recent comic book movies, but has gone largely uncredited, including for the Batsuits in BvS. These guys deserve more credit. Also bonus alt (and better) Apocalypse costume.",
"link": "https://youtu.be/EBi_TqieaQ4",
"score": "1111",
"user": "eternallylearning"
}
#Example youtube.json
{
"title": "Cats In Hats ~ best 18 cats in hats",
"views": "10,596 views",
"channel": "ESL and Popular Culture",
"desc": "more cat videos here http://www.youtube.com/playlist?list=PL-rmNKGsfF5VkbOQeQr... Cat Wearing Funny Hat ..."
}{
"title": "Cats With Hats (Extended Version) | Go You GoDaddy Commercial",
"views": "8,742 views",
"channel": "GoDaddy",
"desc": "Johanna has a passion for making hats for cats. GoDaddy helped her turn her crazy idea into a crazy successful business."
}{
"title": "Kittens Wearing Funny Hats (Cute cat pictures with funny song)",
"views": "24,370 views",
"channel": "Samuel Stokes",
"desc": "MP3 Purchase Link: http://www.sheetmusicplus.com/title/20056355 This is a song about putting off doing anything important in ..."
}{
"title": "Cat In The Hat Trailer",
"views": "1,133,559 views",
"channel": "Tim Armstrong",
"desc": "Cat In The Hat Trailer."
}