Created
May 30, 2017 07:02
-
-
Save CorentinDy/2634e6b8070b5a444fcaaa43ed57a0d9 to your computer and use it in GitHub Desktop.
Js to grab last update from meltdown's planning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scrapeIt = require("scrape-it"); | |
// use it with a city argument like "Toulouse" -> $ node rss.js Toulouse | |
var city = process.argv[2]; | |
if(city){ | |
scrapeIt("https://www.meltdown.bar/"+city+"/planning", { | |
// Fetch the planning content | |
items: { | |
listItem : ".left-row" | |
,data : { | |
date: { | |
selector: ".date" | |
}, | |
title: { | |
selector: ".right-text > h3" | |
}, | |
description:{ | |
selector: ".event-desc" | |
} | |
} | |
} | |
}, (err, page) => { | |
console.log(err || page); | |
}); | |
} else { | |
console.log('No city selected.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment